Tool/software: Code Composer Studio
I began by trying to add a complex package of Java API function provided by Peak to interface a can bus driver over USB. Realizing I had class path problems I followed the example in thread
HOWTO add a user .jar to DSS.BAT javascript *with* eclipsec.exe - Need to use CCS GUI eclipse simultaneously with rhino debugger with .js with user supplied .jar
by downloading the trivial example com.ti.test.zip and trying to successfully execute the example. So far, I cannot do even that. I went so far as to truncate the path to only my working directory, but I can't seem to get the importPackage() function to add the package, nor execute the example "Hi" function. I'm using the dss.bat to invoke the Rhino/js script shown here.
I'm an embedded C/C++ developer and am new to Java.
MOMScript.js
importPackage( Packages.java.lang );
importPackage( Packages.java.io );
importPackage( Packages.java.math );
print("_____________________________");
//MyClassPath = "C:\\_svn_repos\\_BRANCHES\\NGJ_MC_01_04_JS\\DSP\\SEU\\JVScript;" + System.getProperty("java.class.path") ;
MyClassPath = "C:\\_svn_repos\\_BRANCHES\\NGJ_MC_01_04_JS\\DSP\\SEU\\JVScript" ;
System.setProperty("java.class.path", MyClassPath)
System.setProperty("java.library.path", MyClassPath)
print("class.path="+System.getProperty("java.class.path"));
print("library.path="+System.getProperty("java.library.path"));
print("_____________________________");
importPackage(Packages.com.ti.test)
//print(new Echo().say("hi"));
packs = java.lang.Package.getPackages()
var sstr="xxxy";
for (p in packs)
{
sstr = String(packs[p]);
if ((sstr.indexOf("xyzzy.") != -1) ||
(sstr.indexOf("ti.") != -1) ||
0
)
{
print(packs[p]);
}
}
and the results
08/30/2019 13:45 749 xyzzy.jar
28 File(s) 419,478 bytes
19 Dir(s) 126,350,622,720 bytes free
C:\_svn_repos\_BRANCHES\NGJ_MC_01_04_JS\DSP\SEU\JVScript>dss MOMScript.js
_____________________________
class.path=C:\_svn_repos\_BRANCHES\NGJ_MC_01_04_JS\DSP\SEU\JVScript
library.path=C:\_svn_repos\_BRANCHES\NGJ_MC_01_04_JS\DSP\SEU\JVScript
_____________________________
package com.ti.ccstudio.rhino
package com.ti.ccstudio.rhino.internal
C:\_svn_repos\_BRANCHES\NGJ_MC_01_04_JS\DSP\SEU\JVScript>