This content has been marked as final. Show 13 replies
Like I said I am a serious novice. I am reading into the JAR files. It seems like this is what I want and will work. When I am entering these commands should I just create a new class of should this all be entered into the first lines of my main? I feel like I need to go track down a student to do this for me because after reading a little it seems as though it is just a few key strokes and 5 min of work and I am just not getting it yet. I just need to be able to put a file on disk and hand it over to some people to approve. They need to be able to just open the little program or double click it to run the program I have.
When I am entering these commandsWhat commands?
If you mean the "jar" command, it is entered at the command line - the same place you compile your program. (I don't use Sun Java Studio Creator but there be some method to specify and create the jar file within that. The tutorial covers the concepts and how to apply them from the command line/Console/terminal.
DrLaszloJamf wrote:I have noticed that the chicken goes over better at dinner parties than worms.
jbish wrote:That's like showing up at a dinner party with a bucket of chicken. Bucket o' chicken, can o' worms...
DrLaszloJamf wrote:Well, if you don't have the JRE installed...
I vote for the executable jar option. I don't see any advantage to an exe.
But then, that's a whole can o'worms.
jar command which would be jdk/bin directory could be used to create, view and extract jar files..
Say, the Something.java, Something.class files are in C:\code directory... then
jar -cvf Something.jar Something.class
that creates the jar file.. if you want to execute it
java -jar Something.jar.
hope this helps..
The executable jar file is your best bet if you want to use java. If you want a real executable, you need to consider C or C++.
The whole idea of a real executable is a bit outdated. Java, VB and C# don't produce these and scripting languages like perl or functional languages like lisp or forth require their interpreter. Real compiled languages tend to require far longer development times to implement a solution, even if they do run a bit faster. And software is usually obsolete long before the faster run time outweighs the longer development time.
Have your class files in a folder.
Let's say you have 3 classes
And the MainFile.class is the entry-point (has the main method) for your application, and you want to name your final file that your client will see "MyApplication.jar" :
From command line (make sure the folder that contains your class files is the current folder) type:
jar cvfe MyApplication.jar MainFile \*.\*
if you want to know what the c, v, f, and e do, see: