11-20-2003, 10:46 PM | #1 (permalink) |
The GrandDaddy of them all!
Location: Austin, TX
|
Java stand-alone apps
How exactly do i make one? i have a stand-alone *.java file, but i cant seem to make this an exe. the ide runs the file and produces the output, but how do i get it to run w/o an ide?
thanks!
__________________
"Luck is what happens when preparation meets opportunity." - Darrel K Royal |
11-21-2003, 01:22 PM | #2 (permalink) |
Junkie
Location: North Hollywood
|
well java doesn't run as an exe, since exe's are native code, the java interpreter java.exe is native though so you use that to start off your class. (the .java file is source so it needs to be compiled anyway, use javac from sun.java.com ) though it looks like you can already compile it to a class.
you can then package it into a jar and/or just run it with java classname.class etc There are probably some class/jar > exe wrappers but they will likely do the same thing, the simplest thing is just to make a .bat file with the java classname.class command in it. so a file called test.java goes to test.class which you can either run or package into a jar, and then run with either java test.class or java -jar test.jar on my window setup, i have jars automatically run by double click into the KVM, but since there are many flavours of java there isn't one global solution for that. |
11-22-2003, 09:06 AM | #3 (permalink) |
Upright
|
You can also use the 'Main-Class' attribute in the jar manifest, so that double clicking on the jar, or java -jar my.jar will work:
http://java.sun.com/docs/books/tutor.../manifest.html |
11-24-2003, 07:11 AM | #4 (permalink) |
Dead Inside
Location: East Coast, USA
|
You want nice pretty shortcut icon so that it runs just like a Windows native program? Double-click and run.
I don't know how to do it by hand but I know it can be done. InstallAnywhere from zeroG is good java deployment tool. http://www.zerog.com/ jEdit is very nice program that I use pretty much everday. www.jedit.org I like how JDisktReport looks and runs. Installs nicely. http://www.jgoodies.com/ |
Tags |
apps, java, standalone |
|
|