We help IT Professionals succeed at work.

Packaging application runnable jar?

AndyC1000
AndyC1000 asked
on
Dear all,

I've completed stage 1 of an application using Eclipse.  At this stage no user interface just a number of arguments in the run configuration.  Can I create a runnable jar considering users will need to change the arguments? Or should I create a batch file to run from command line?

I've tried to export a runnable jar however I get export errors and compile warnings for java classes that are in a different package to the main.  As well as this message - Class files on classpath not found or accessible for a class file.

Tried creating a batch file to run the app from the command line, I haven't created one before.

"C:\Program Files\Java\jre1.8.0_25\bin\javaw.exe" -agentlib:jdwp=transport=dt_socket,suspend=y,address=localhost:60141 -Dfile.encoding=Cp1252 -classpath "C:\Testing_ALP\AppliancePlatform\bin;C:\Kepler SR1\eclipse\plugins\org.junit_4.11.0.v201303080030\junit.jar;C:\Kepler SR1\eclipse\plugins\org.hamcrest.core_1.3.0.v201303031735.jar" java au.lw.platform.model.HalfHourlyApplianceModel C:\Testing_ALP\AppliancePlatform\data\test.csv C:\Testing_ALP\AppliancePlatform\output\ 0.003 2 4 13/03/2014 12/03/2015 1000

Open in new window


Thanks
Comment
Watch Question

Author

Commented:
I watched the you tube video earlier when I first tried to export the runnable jar there are export errors and compile warnings for java classes that are in a different package to the main.

I've compiled the code from the command line and there are errors that the packages don't exist.  Even though they do.
Top Expert 2016

Commented:
zzynxSr. Software engineer

Commented:
In case you didn't get the message: CEHJ wants you to post the errors you get.

Author

Commented:
The message was "Exported with compile warnings somepackage/class.java" I assumed it was an error.
Top Expert 2016

Commented:
Yes, you don't export to jar before the application even compiles ;)
zzynxSr. Software engineer

Commented:
Thanx 4 axxepting