This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Tool/software: Code Composer Studio
I have a .java file that I'm using to write to specific sections of flash on my board. I'm using the dss java libraries.
I create a .class file by running this on terminal:
javac -cp "/Applications/ti/ccsv6/ccs_base/DebugServer/packages/ti/dss/java/com.ti.ccstudio.scripting.environment_3.1.0.jar":"/Applications/ti/ccsv6/ccs_base/DebugServer/packages/ti/dss/java/com.ti.debug.engine_1.0.0.jar":"/Applications/ti/ccsv6/ccs_base/DebugServer/packages/ti/dss/java/dss.jar" flasher.java
then I run the .class:
java -cp ".":"/Applications/ti/ccsv6/ccs_base/DebugServer/packages/ti/dss/java/dss.jar":"/Applications/ti/ccsv6/ccs_base/DebugServer/packages/ti/dss/java" flasher
I'd like to create a single .jar file that I can call from the terminal.
So far i've tried commands like:
jar -cfve flasher.jar main flasher.class
When I run the .jar file that this generates I get errors like 'could not find or load main class flasher.jar'.
What's the right way to compile a .jar file using all the dss libraries?
I have specified a manifest file with the following command.
jar -cvfm flasher.jar manifest.txt flasher.class
my manifest.txt looks like this:
Main-Class: flasher.class
Class-Path: . /Applications/ti/ccsv6/ccs_base/DebugServer/packages/ti/dss/java/dss.jar /Applications/ti/ccsv6/ccs_base/DebugServer/packages/ti/dss/java
When I run the generated .jar file I get the following error:
flasher(master) > java -jar flasher.jar Error: Could not find or load main class flasher.class
Looking at the created manifest I see the following:
flasher(master) > unzip -p flasher.jar META-INF/MANIFEST.MF Manifest-Version: 1.0 Class-Path: . /Applications/ti/ccsv6/ccs_base/DebugServer/packages/ti/ dss/java/dss.jar /Applications/ti/ccsv6/ccs_base/DebugServer/packages /ti/dss/java Created-By: 1.8.0_111 (Oracle Corporation) Main-Class: flasher.class
That worked! I can run the generated .jar file with the java -jar flasher.jar command
I also want flasher.jar file to be self contained. I modified manifest.txt and copied the contents of /Applications/ti/ccsv6/ccs_base/DebugServer/packages/ti/dss/ into the same directory of flasher.jar but I can't get it to run properly. My updated manifest.txt is:
Main-Class: flasher
Class-Path: . ./java/dss.jar ./*
If I change the Class-Path to the following and create a new .jar file, it runs fine:
Class-Path: . /Applications/ti/ccsv6/ccs_base/DebugServer/packages/ti/dss/java/dss.jar /Applications/ti/ccsv6/ccs_base/DebugServer/packages/ti/dss/
The error I'm getting seems to be when I try to open a debug server session. The line is:
debugSession = debugServer.openSession("Texas Instruments XDS100v2 USB Debug Probe/C28xx_CPU1");
and the error I get is: SEVERE: Can not connect to DebugServer. Path not found: '/Users/<userName>/<dirOne>/bin'
I'm running the file from: /Users/<userName>/<dirOne>/<dirTwo>/flasher/build/flasher.jar
Should I be including some more files in my directory?
I think I figured out what's happening. It looks like some of the files (probably dss.jar) call other files relative to it's path and end up going up and down the directories. The .jar runs if I put the contents of /Applications/ti/ccsv6/ccs_base/ in my project directory where flasher.jar is and I change my manifest file to the following:
Main-Class: flasher
Class-Path: . ./ccs_base/DebugServer/packages/ti/dss/java/dss.jar ./ccs_base/DebugServer/packages/ti/dss/java