?
Solved

make java class files into exe

Posted on 2003-11-11
6
Medium Priority
?
542 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 60 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Suggested Courses
Course of the Month11 days, 7 hours left to enroll

752 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