File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes .class file into .exe file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark ".class file into .exe file" Watch ".class file into .exe file" New topic

.class file into .exe file

sakthivel shan

Joined: Nov 11, 2002
Posts: 7
Dear All,
I have a java program....and the compiled ".class" file for this....basically, it is a Frame..i will run this said program from my command prompt like,
C:\java megalaunch
...the frame will appear now....
what i want to know is .............Is it possible to change this said class file, in to an .exe that, (instead of going for a command prompt for running the said program) i can just double click the said .exe file and start that said Frame....
pl. post a reply,
Sakthivel S.
Cindy Glass
"The Hood"

Joined: Sep 29, 2000
Posts: 8521
Making an .exe file is the least best choice you could make.
You can .jar your app and then have the user (or icon) click the .jar file and it will invoke java.
Since this is apparently a Windows app (this exe you were talking about would be platform specific) you can just create a .bat file. that gives you the opportunity to change directories, modify the path if needed, invoke the java application naming your preferred classpath on the way and referencing any input parameters that you might want.
There are lots of examples of this scatterred through the Beginner and Intermediate forums.
You of course will want to find the example in the Intermediate Forum if possible .
Guennadiy VANIN
Ranch Hand

Joined: Aug 30, 2001
Posts: 898
OK, I tried to rename .bat file to .exe... And it does give an error
Cindy Glass
"The Hood"

Joined: Sep 29, 2000
Posts: 8521
You would have to COMPILE something into an .exe file. You would need a tool capable of compiling the initial language into a binary file for the target platform.
Cindy Glass
"The Hood"

Joined: Sep 29, 2000
Posts: 8521
And at any rate it would NEVER be the .bat file stuff that would go into an .exe.
What exactly are YOU trying to accomplish?
Stewart Griffin

Joined: Dec 02, 2002
Posts: 23
Check out.....
This software will turn your java programs
into .exe's
Downside is it takes about 30 mins to install!
I've had a couple of problems with this,
but a few of my friends swear by it.
Upside is that your programs will run much
I agree. Here's the link:
subject: .class file into .exe file
jQuery in Action, 3rd edition