Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > executing a jar

Reply
Thread Tools

executing a jar

 
 
Lloyd Harlow Yap via JavaKB.com
Guest
Posts: n/a
 
      04-14-2005
how to make a executable jar files

--
Message posted via http://www.javakb.com
 
Reply With Quote
 
 
 
 
T.
Guest
Posts: n/a
 
      04-14-2005
Lloyd Harlow Yap via JavaKB.com wrote:
> how to make a executable jar files
>


I'd Google on Manifest-files. You have to create a jar (with the
commandline jar tool that is included in the JDK) that contains your
classfiles (in directories that match the packages) and a directory
MANIFEST. That dir contains the manifest-file (google!) with the
classpath and the main class.


T.
 
Reply With Quote
 
 
 
 
Thomas Kellerer
Guest
Posts: n/a
 
      04-14-2005


On 14.04.2005 11:34 Lloyd Harlow Yap via JavaKB.com wrote:
> how to make a executable jar files
>


http://java.sun.com/docs/books/tutorial/jar/
 
Reply With Quote
 
Malte
Guest
Posts: n/a
 
      04-14-2005
Lloyd Harlow Yap via JavaKB.com wrote:
> how to make a executable jar files
>


If you do not have a tool, this will work (assumes *ix terminal). On
Windows you could probably right mouse click on something in the filemanger:

1. jar cvf myjar.jar myclass.class

2. jar -xf myjar.jar

3. cp META-INF/MANIFEST.MF .

4. vi MANIFEST.MF

5. add this line

Main-Class: mypackage.Class1

or whatever class in the package has the main method

5. jar -cvmf MANIFEST.MF myjar.jar myclass.class

java -jar myjar.jar
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
java -cp a.jar -jar b.jar => Works on Windows, not on Debian cyberco Java 4 02-14-2006 06:27 AM
jaas.jar, jta.jar jdbc-stdext.jar missing from jdk1.5 RPM muttley Java 0 10-20-2005 02:40 PM
executing a jar file inside outlook express Dotty Java 0 03-07-2005 10:07 PM
Differences of xercesImpl.jar, xercesImpl-J.jar, dom3-xercesImpl.jar ? Arnold Peters Java 0 01-05-2005 10:59 PM
Differences of xercesImpl.jar, xercesImpl-J.jar, dom3-xercesImpl.jar ? Arnold Peters XML 0 01-05-2005 10:59 PM



Advertisments