help with .jar files
It seems like all of the examples and tutorials on this are extremely vague, so I thought that someone might give me specific instructions.
How do I make an executable .jar file out of my project? I have a simple program called calculator.java, located in C:\Java\calc\calculator.java. I gather that I need to make a manifest file manifest.mf, but what exactly do I need to put in it, and then what do I do? I think that I'm supposed to go to the command prompt and write somthing like:
jar cfm calc.jar , with stuff after this also
So what exactly do I do? I'm very confused that this is not easier to do in Java, it seems like there should be a simpler way of making an executable java program, like .exe's in C++, etc.
Thanks in advance for any help!
creating jar file from command line
my manifest file says only this:
where MainFrame is the class with your main(String args) method.
So where do I go in the command prompt? Which directory do I go to to write the command in? If I go to the directory of my project, I get an error that jar is not a recognized cammand. If I go to the java bin directory where jar.exe is, It says that it can't find the calculator class. Thanks for your reply, but I need more specifics, please.
Go to this thread. It is a link to a tutorial for making JAR files written by the user Cjard (on a different forum, but he's also a member of this one). If you read the first few posts it gives a step by step method to create a JAR file.
Thanks for that link! I finally got it. The problem was that I did not have jar.exe in the folder with the program in it. I don't know if it's the standard way to do it, but I put a copy of jar.exe in my program folder and then everything worked. I probably should have realized this when the error was " 'jar' is not a recognisable command". Anyway, thanks alot for the help. Problem solved.