PDA

Click to See Complete Forum and Search --> : [RESOLVED] How to package a JSwing app?


DonCash
Aug 7th, 2007, 04:38 AM
Hey,

I am used to writing Java programs which run on a command line.

I normally make a jar file and run this command in unix:

java -jar myapp.jar

to run the file...

I have wrote a Java Swing app for the first time and am wondering how I package this up for users to be able to run it?

jar files don't seem to do it.

Any ideas? :confused:

Thanks for the help! :thumb:

ComputerJy
Aug 7th, 2007, 12:29 PM
JAR files are executables, users only need the JRE to run them

DonCash
Aug 8th, 2007, 02:49 AM
Yeah,

So can a Swing application be packaged into a Jar and run in the same way?

I've tried this already but doesn't seem to work.

How else can a Swing app be executed?

ComputerJy
Aug 8th, 2007, 12:11 PM
So can a Swing application be packaged into a Jar and run in the same way?Yes, you just need to use the command line correctly.

Example 1: to archive two class files into an archive called classes.jar:
jar cvf classes.jar Foo.class Bar.class
Example 2: use an existing manifest file 'mymanifest' and archive all the
files in the foo/ directory into 'classes.jar':
jar cvfm classes.jar mymanifest -C foo/ .

DonCash
Aug 17th, 2007, 02:42 AM
Thanks.