exe

A

Anandharaj @ Ajay

how to make java program to an .exe file? or standalone files?
so tht we can just click at the icon and the program will open

--

*****************************************
"Don't leave alone someone who are close with you
because you will feel left when that 'someone'
go far from you..."

Best Regards,

- Anan @ Ajay -
http://www.geocities.com/anan_ajay
 
R

rob hadow

Anandharaj @ Ajay said:
how to make java program to an .exe file? or standalone files?
so tht we can just click at the icon and the program will open

--

*****************************************
"Don't leave alone someone who are close with you
because you will feel left when that 'someone'
go far from you..."

Best Regards,

- Anan @ Ajay -
http://www.geocities.com/anan_ajay
I have been working on this problem too.
I found the best way is to put your class files in a package, and put the
package in a JAR file.
I found this web site most helpful.

http://csdl.ics.hawaii.edu/~johnson/613f99/modules/04/jar-files.html

Rob Hadow
 
A

Alan Meyer

Anandharaj @ Ajay said:
how to make java program to an .exe file? or standalone files?
so tht we can just click at the icon and the program will open

Here is a way to make a single command to start
a java program - but it's not an executable file.

1. Make all the classes part of a package.
2. Put all the class files in a jar file.
3. Create a batch file or shell script to start it.

For example, assume your application has three classes:
Class1.class (this one has the main method)
Class2.class
Class3.class

Put them all in a package, e.g., MyPackage.jar

Create a batch file with the following contents:

java -cp ./MyPackage.jar MyPackage/Class1

Assuming your users have java installed, you only
have two files to distribute - the batch file and the
jar file. And the user can start the program just by
executing the batch file.

Alan
 
A

Andrew Thompson

how to make java program to an .exe file? or standalone files?
so tht we can just click at the icon and the program will open

rob and Alan gave you the low-down on
the advantage of jar files,
<http://www.physci.org/codes/javafaq.jsp#jar>
...and for delivering you app to the client by JWS
<http://www.physci.org/codes/javafaq.jsp#jws>

But I will also add some details to your 'exe' option
<http://www.physci.org/codes/javafaq.jsp#exe>
(which also links to Roedy's site, as that seems
the most comphrehensive page describing
native compilation)
 
R

Ryan Stewart

Alan Meyer said:
Here is a way to make a single command to start
a java program - but it's not an executable file.

1. Make all the classes part of a package.
2. Put all the class files in a jar file.
3. Create a batch file or shell script to start it.
*snip*
You don't need the batch file. Include a manifest file in the JAR specifying
the main class. Then you can double click the JAR to run. I'm not sure what
all Java versions automatically associate a Java runtime with JAR files.
Anyone?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,679
Members
48,796
Latest member
Greg L.

Latest Threads

Top