The Artima Developer Community
Sponsored Link

Java Answers Forum
How to write an exe file for a java project?

5 replies on 1 page. Most recent reply: Apr 29, 2005 8:21 AM by Matt Gerrans

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 5 replies on 1 page
Kiran Karnati

Posts: 3
Nickname: kkarnati
Registered: Mar, 2005

How to write an exe file for a java project? Posted: Apr 26, 2005 3:21 AM
Reply to this message Reply
Advertisement
Hello friends,

I am Kiran , very new to this Forum and also for java programming, my SE programmed a java project.

now I got to do two things --

1.I have to create a jar file with those class files and also an exe file which can execute that jar file.

2. I have to write a "setup file" for automatic instalation of my Java project.

so I request my friends to help in these two issues by providing some suggestions to do them.

Thank you in advance.

Kiran Karnati.


Matthias Neumair

Posts: 660
Nickname: neumi
Registered: Sep, 2003

Re: How to write an exe file for a java project? Posted: Apr 26, 2005 10:47 PM
Reply to this message Reply
A jar file is basically a ZIP file with another extension.

Use the command jar.exe in your %javahome%\bin directory.

If java is instqlled correctly, you don't need a exe file.
Double click on the jar file.

But: the jar file must contain a file named META-INF\MANIFEST.MF
This file must contain the line
"Main-Class: YourMainClass"
If this line is the last one in the Manifest file, don't forget to add an additional empty line.

If you want to create an exe file: Java does not offer the possibility to create .exe files.
There are some tools, however, wich create one.
I use "exe4j", the current version should be 3.0.2
The free version is like the full version, only that it adds a hint window at program start.

Ralf Kraus

Posts: 2
Nickname: darkvamp
Registered: Apr, 2005

Re: How to write an exe file for a java project? Posted: Apr 28, 2005 2:22 AM
Reply to this message Reply
Hi,

I personly like LaunchAnywhere....

Infos are here :

http://www.zerog.com/iamanual/usermanual_ia55/WebHelp/launchanywhere/abo12e.htm

Greets .DarkVamp.

Matt Gerrans

Posts: 1153
Nickname: matt
Registered: Feb, 2002

Re: How to write an exe file for a java project? Posted: Apr 28, 2005 8:05 AM
Reply to this message Reply
Sounds like you could just write a little exe that simply runs "java -jar" on the jarfile.

Matthias Neumair

Posts: 660
Nickname: neumi
Registered: Sep, 2003

Re: How to write an exe file for a java project? Posted: Apr 29, 2005 2:48 AM
Reply to this message Reply
That would be enough - but then you still would have "java.exe" or "javaw.exe" in your task manager. Would look much cooler if there would only be the name of the lancher.

Matt Gerrans

Posts: 1153
Nickname: matt
Registered: Feb, 2002

Re: How to write an exe file for a java project? Posted: Apr 29, 2005 8:21 AM
Reply to this message Reply
Hmm... You could always copy java.exe to "MyNiftyApplicationName.exe" and call that. ;-)

Flat View: This topic has 5 replies on 1 page
Topic: Help with data structures Previous Topic   Next Topic Topic: Editing in a JList

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use