Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Need help creating jar files
Index -> Programming, Java -> Java Help
Goto page 1, 2  Next
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
jin




PostPosted: 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
Sponsor
sponsor
wtd




PostPosted: 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. Wink
1of42




PostPosted: 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. Wink


Or you could tell him how to do it... Rolling Eyes

But to the original poster: there is a thread here about how to do it.
wtd




PostPosted: 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




PostPosted: 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




PostPosted: 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




PostPosted: 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




PostPosted: Fri Jun 24, 2005 11:29 pm   Post subject: (No subject)

Here's everything you need to know about JAR files. But, you don't really need to make it a .jar file to be runnable outside of RTP.
Sponsor
Sponsor
Sponsor
sponsor
jin




PostPosted: 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




PostPosted: 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




PostPosted: Mon Jun 27, 2005 11:33 pm   Post subject: (No subject)

can you giveme a link from where i can get standard JDK
wtd




PostPosted: Tue Jun 28, 2005 12:27 am   Post subject: (No subject)

http://java.sun.com
jin




PostPosted: Tue Jun 28, 2005 12:40 pm   Post subject: (No subject)

i installed JDK so how do i open my program using that
wtd




PostPosted: 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




PostPosted: 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?
Display posts from previous:   
   Index -> Programming, Java -> Java Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 2  [ 26 Posts ]
Goto page 1, 2  Next
Jump to:   


Style:  
Search: