Solved

make java class files into exe

Posted on 2003-11-11
6
531 Views
Last Modified: 2013-11-23
hi,
       i want to run my java application to run when i clicked it. i want to make the java class files in to exe file.i want  to know the procedure for creating the jar and manfiest file.
tell me what should be in the manfiest file
thank u
0
Comment
Question by:deeppradeep
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 35

Expert Comment

by:TimYates
ID: 9724763
You don't want an exe file

Just an executable jar file

manifest should read:

Main-Class: MainClass
Classpath: whatever

Replacing MainClass, and whatever with your class and classpath
0
 
LVL 2

Accepted Solution

by:
SuperKarateMonkey earned 20 total points
ID: 9725050
TimYates is right, you don't really want to to compile to an .exe file.  It loses you all platform independence, and in most cases will also lose you alot of the cool things java can do, such as dynamic class loading.  The vastly superior option is to create an executable jar file the way Tim just described, and then go through the control panel:

Folder Options --> File Types --> Executable Jar File --> Advanced --> Select, (or create,) the 'open' command -->

and then under the field "Application used to perform action," put in this:

"C:\Program Files\Java\j2re1.4.1_01\bin\java.exe" -jar "%1" %*

Although the exact location of your java.exe file might change depending on where you installed java, and which version you're using.  You'll have to locate the JRE directory on your own.
0
 
LVL 15

Expert Comment

by:Javatm
ID: 9726047
This steps will help create a good jar file :
http://www.experts-exchange.com/Programming/Programming_Languages/Java/Q_20774096.html

Hope this helps . . .
JAVATM
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Expert Comment

by:illucid
ID: 9727588
or you could download this..

http://www.javaapis.com/execjava/

..if you want an exe that runs a java app
0
 

Author Comment

by:deeppradeep
ID: 9755019
i had created the manifest file test.tmp
Main-Class : test

where test is my simple program not in a GUI.
it will only print the message "my first program" in the command window
i had created test.jar file also
and when i run the jar file in the command promt
java -jar test.jar
then it give error message "main class name not loaded"

what is this and how can i run this???
0
 
LVL 15

Expert Comment

by:Javatm
ID: 9783994
How did you do it :

Make sure that you are in your base directory then try this
c:\jdk1.4.2\javac\bin\jar Filename.jar manifest.tmp *.class

Also make sure that when you use this :
java -jar test.jar

Your are at your base directory & make sure that
test is your main class.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
The viewer will learn how to implement Singleton Design Pattern in Java.

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question