Author |
Message |
jin
|
Posted: Wed Jun 22, 2005 5:04 pm Post subject: Need help creating jar files |
|
|
Hi i am using "Ready to Program" to make java programs. I have made a programs called "database.java" and want to make it into a jar file so i can open the database without using"Ready to Program". |
|
|
|
|
|
Sponsor Sponsor
|
|
|
wtd
|
Posted: Wed Jun 22, 2005 5:18 pm Post subject: (No subject) |
|
|
If you're using a lower-case letter at the beginning of a class, then you're not following the Java style guidelines. |
|
|
|
|
|
1of42
|
Posted: Wed Jun 22, 2005 9:52 pm Post subject: (No subject) |
|
|
wtd wrote: If you're using a lower-case letter at the beginning of a class, then you're not following the Java style guidelines.
Or you could tell him how to do it...
But to the original poster: there is a thread here about how to do it. |
|
|
|
|
|
wtd
|
Posted: Wed Jun 22, 2005 11:05 pm Post subject: (No subject) |
|
|
Well, in case you're thinking I'm just a jerk... I'm not. I simply like to point out mistakes.
"Right, because you're a jerk..."
You're likely tempted to think so, but that's still not right. What jin is asking to do is not a first week kind of thing. Before anyone moves on, they should have the intro stuff down. Clearly that's not the case.
Fail early, fail often, and fail hard. Continuing to program without being told that you're doing simple things wrong just reinforces bad habits. |
|
|
|
|
|
Naveg
|
Posted: Fri Jun 24, 2005 6:26 am Post subject: (No subject) |
|
|
Let me tell you, trust wtd. He's done more for my programming skills than my compsci teacher did this year. And believe me he knows what he's talking about. |
|
|
|
|
|
jin
|
Posted: Fri Jun 24, 2005 9:29 am Post subject: (No subject) |
|
|
sorry bout the name it is "Database.java".i looked at that thread and i dont get it. it says type "java -jar filename.jar" in command prompt and next poster is talking bout a manifest file.
could someone explain to me wat to do step by step. |
|
|
|
|
|
1of42
|
Posted: Fri Jun 24, 2005 3:40 pm Post subject: (No subject) |
|
|
The way I did it was to put all the class files I needed into the bin directory in the j2sdk directory. Also put in a manifest file, which should read something like this:
code: |
Manifest-Version: 1.2
Created-By: 1.4.2_04 (Sun Microsystems Inc.)
Main-Class: YourMainClassHere(No .class extension)
|
Make sure there is a new line after the main-class. Call the file manifest.txt or something. Then use the following command line command to make a jar
jar -cvmf manifest.txt <JarName>.jar [List of class files] |
|
|
|
|
|
Hikaru79
|
|
|
|
|
Sponsor Sponsor
|
|
|
jin
|
Posted: Mon Jun 27, 2005 3:54 pm Post subject: (No subject) |
|
|
Quote: But, you don't really need to make it a .jar file to be runnable outside of RTP.
whats the other way cause creating a jar file is confusing.[/quote] |
|
|
|
|
|
wtd
|
Posted: Mon Jun 27, 2005 3:55 pm Post subject: (No subject) |
|
|
jin wrote: Quote: But, you don't really need to make it a .jar file to be runnable outside of RTP.
whats the other way cause creating a jar file is confusing.
Install the standard JDK and use that instead? |
|
|
|
|
|
jin
|
Posted: Mon Jun 27, 2005 11:33 pm Post subject: (No subject) |
|
|
can you giveme a link from where i can get standard JDK |
|
|
|
|
|
wtd
|
|
|
|
|
jin
|
Posted: Tue Jun 28, 2005 12:40 pm Post subject: (No subject) |
|
|
i installed JDK so how do i open my program using that |
|
|
|
|
|
wtd
|
Posted: Tue Jun 28, 2005 1:31 pm Post subject: (No subject) |
|
|
Open a Command Prompt window, move to the directory that contains your class file, and run "java MyProgramName". |
|
|
|
|
|
jin
|
Posted: Tue Jun 28, 2005 8:44 pm Post subject: (No subject) |
|
|
i successfully made a jar file using the "jar-cmf" code but that worked for an applet program but not the database program ehich is an application.
is there another code for an application to jar? |
|
|
|
|
|
|