Skip to content

Instantly share code, notes, and snippets.

@rikka0w0
Last active August 15, 2021 17:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rikka0w0/c220cabd203ca3e157656a96ac97d34e to your computer and use it in GitHub Desktop.
Save rikka0w0/c220cabd203ca3e157656a96ac97d34e to your computer and use it in GitHub Desktop.
CCS10.4 on Java 16

The DVT module calls "sun.reflect.Reflection.getCallerClass".

The alternative method using StackWalker (since Java 9):

    public static Class<?> getCallerClass(int n) {
        try {
        	List<StackFrame> stack = StackWalker.getInstance(StackWalker.Option.RETAIN_CLASS_REFERENCE).walk(s -> s.limit(n).collect(Collectors.toList()));
        	StackFrame stackFrame = stack.get(stack.size()-1);
        	return stackFrame.getDeclaringClass();
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }

Compile and replace the class file ("com.ti.dvt.util.install.Install") in ./ccs1040/ccs/ccs_base/dvt_4.1.0.202105121547/bin/com.ti.util_4.1.0.202105121547.jar

Nashron JavaScript is missing since Java 15

Use standalone Nashron from OpenJDK. Create a folder named "nashron" in the same folder with "ccstudio.exe" and "eclipse.exe", unzip the jars into the newly created folder. Edit "./ccs1040/ccs/eclipse/plugins/com.ti.dvt.control.engine_4.1.0.202105121547/META-INF/MANIFEST.MF":

Bundle-ClassPath: .,
 com.ti.dvt.control.engine.jar,
 external:$eclipse.launcher$/../nashorn/asm-7.3.1.jar,
 external:$eclipse.launcher$/../nashorn/asm-analysis-7.3.1.jar,
 external:$eclipse.launcher$/../nashorn/asm-commons-7.3.1.jar,
 external:$eclipse.launcher$/../nashorn/asm-tree-7.3.1.jar,
 external:$eclipse.launcher$/../nashorn/asm-util-7.3.1.jar,
 external:$eclipse.launcher$/../nashorn/nashorn-core-15.3.jar

org.eclipse.cdt.utils.Platform is removed

The correct alternative should be org.eclipse.core.runtime.Platform. For now, copy org/eclipse.cdt/utils/Platform.class from the legacy jar into the new jar fixes the problem.

org.eclipse.jface.util.Assert and its sub classes are removed

Copy Assert.class and its sub class(es) from the legacy jar org.eclipse.jface_xxx.jar to the new jar.

org.eclipse.ui.internal.misc.StringMatcher is removed

Should use org.eclipse.core.text.StringMatcher, but here we just copy StringMatcher and its subclasses into the new jar.

Manifest-Version: 1.0
Bundle-SymbolicName: com.ti.dvt.control.engine;singleton:=true
Require-Bundle: com.ti.dvt.core,com.ti.dvt.datamodel;visibility:=reexp
ort,org.apache.ant;visibility:=reexport,org.eclipse.ant.core;visibili
ty:=reexport,org.eclipse.core.runtime;visibility:=reexport,com.ti.dvt
.analysis.framework;visibility:=reexport,com.ti.util,com.ti.dvt.idead
apter2
Bundle-ManifestVersion: 2
Bundle-RequiredExecutionEnvironment: JavaSE-16
Bundle-ActivationPolicy: lazy
Bundle-Vendor: Texas Instruments
Eclipse-LazyStart: true
Export-Package: com.ti.dvt.control.engine.activities,com.ti.dvt.contro
l.engine.activities.controlxml,com.ti.dvt.control.engine.clone,com.ti
.dvt.control.engine.core,com.ti.dvt.control.engine.errors,com.ti.dvt.
control.engine.plugin,com.ti.dvt.control.engine.sessions,com.ti.dvt.c
ontrol.engine.types,com.ti.dvt.control.engine.types.properties,com.ti
.dvt.control.engine.types.properties.util,org.apache.tools
Bundle-Name: DVT Control Engine
Bundle-Version: 4.1.0.202105121547
Bundle-ClassPath: .,
com.ti.dvt.control.engine.jar,
external:$eclipse.launcher$/../nashorn/asm-7.3.1.jar,
external:$eclipse.launcher$/../nashorn/asm-analysis-7.3.1.jar,
external:$eclipse.launcher$/../nashorn/asm-commons-7.3.1.jar,
external:$eclipse.launcher$/../nashorn/asm-tree-7.3.1.jar,
external:$eclipse.launcher$/../nashorn/asm-util-7.3.1.jar,
external:$eclipse.launcher$/../nashorn/nashorn-core-15.3.jar
Bundle-Activator: com.ti.dvt.control.engine.plugin.ControlEnginePlugin
This file has been truncated, but you can view the full file.
View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment