Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Convert .class to .exe

 
Dominic Steng�rd
Ranch Hand
Posts: 186
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello!
I need to convert an application(.class) into an executable file(.exe). My main problem is that the application uses Swing components, and it has to be able to run on Win 98 and upwards. So my question is how I can make sure that the application will be executable on these platforms even though it uses Swing? Will there be any problems? Will I have to convert the application so it uses AWT components instead?
Thanks!
Dominic
 
Matthew Jones
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why would you need to convert Java class files to and .exe file? Why don't you just incluce the JVM when you distribute your app, and keep it a Java app, that way it can be used on any platform, if you decide later you need to be able to run it on other kinds of compuers.
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JtoEXE is available at this site:
http://javaarchives.javaarchives.com/development_-_java.html
 
Grant Crofton
Ranch Hand
Posts: 154
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
J2EXE isn't a compiler, though, is it - it's like a launcher - it provides an executable to launch your app, but the class files are still in there in their original form.
Not that that really matters, I suppose.
GNU are working on a Java compiler that is freely available, I'm not sure what stage it's at yet.
I hear some commercial packages let you compile java to native executable, but i haven't looked into that.
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you bundle the JRE in with your application it will include the swing stuff.
This explains how to use it http://java.sun.com/products/jdk/1.1.7B/jre/example/index.html
 
Cody Allcorn
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i need to do the opposite make a application into a java applet who can help?(.class)
 
Alexi Jordanov
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try this one:
http://www.geocities.com/j2exe/
 
Jan Michael Soan
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1st of all if you want to create an executable format on a .java program what you need to do is to create a " .jar file " an executable form of java. Here's a guide where you can learn how to create a executable file or jar file.

http://java.sun.com/docs/books/tutorial/jar/basics/build.html
If you still dont know how too then :

Try this for your program create 1st a manifest.tmp file in the notpad of your windows try typing this on you tmp file:
" main-class : yourmain.class "
After you figure out what java program you want to create a .exe for
then type this to the command promt :
c:\jdk1.3.1\javac\bin\jar Filename.jar manifest.tmp *.class
then press enter.
thats it you've just created a jar file.
Filename.jar here is the main java program that you put in the manifest file and also the one that you want to create an .exe for.
After finishing the .exe or the .jar file you can create an installer now, you need 1st to download the InstallAnywhere from http://www.zerog.com
Hope that helps . . .
Life is like a book that you need to review for continues knowledge and growth.
http://javatm.4t.com
My Personal Site
[ September 19, 2003: Message edited by: Jan Michael Soan ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic