Jump to content
  • Advertisement
Sign in to follow this  
cpp_boy

[java] *.java to *.exe

This topic is 5048 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello. I"m working now on little project and I have a little problem. I must convert few "*.java" files into windows "*.exe" files. (I mean that after this conversion of java file I get .exe file that will run on any windows machine without JVM ). THANKS [Edited by - cpp_boy on February 12, 2005 3:34:32 PM]

Share this post


Link to post
Share on other sites
Advertisement
You can't. There are some 3rd party programs that let you do that, but I heard they got problems. What you probably want to do is make a .jar archive. Then, you can double-click on it and it will open the program, which is probably what you want.

Share this post


Link to post
Share on other sites
*.java files are just the java source code, similar to *.c or *.cpp files in function. To turn them into a java application you're going to need a java compiler. Personally, I like the BlueJ IDE, but I know people who would rather use NetBeans, so look around for an IDE that suits you. Java is a cross platform language that runs off of a "virtual machine" on the platforms that support Java. Generally, you would embed Java into an HTML document and have a web browser start the Java application when the HTML page was opened. You could look into Java Web Start if you wanted to package a Java App that could launch itself.

Hope this helps.

Share this post


Link to post
Share on other sites
Quote:
Original post by Foxostro
*.java files are just the java source code, similar to *.c or *.cpp files in function. To turn them into a java application you're going to need a java compiler. Personally, I like the BlueJ IDE, but I know people who would rather use NetBeans, so look around for an IDE that suits you. Java is a cross platform language that runs off of a "virtual machine" on the platforms that support Java. Generally, you would embed Java into an HTML document and have a web browser start the Java application when the HTML page was opened. You could look into Java Web Start if you wanted to package a Java App that could launch itself.

Hope this helps.


I want my java file to run on windows machine without any JVM. Just regular ".exe" file. I dont want to use J# compiler cos its crap.
So maybe there is some other method to compile java file into windows executable file .

Share this post


Link to post
Share on other sites
There is Excelsior JET:
http://www.excelsior-usa.com/jet.html
,but it costs money.

Then there is the free gcj: http://gcc.gnu.org/java/

Both will probably have their issues. In particular if you use awt.

You could also include the jre with your application if you don't mind adding 15MB to it.

Or even better, stick with c++.

Share this post


Link to post
Share on other sites
Using statical compilation kinda limits life of your application. Standard .jar files would jump in speed on multicores, and with new instrucitons sets, statically compiled ones would just be buggy and crawl. The only advantage would be if your user would expect exe because he didn't experience anything different, and you are unable to educate him a little.
Then wrapper, or link on desktop would do wonders.

Share this post


Link to post
Share on other sites
Quote:
Original post by cpp_boy
Thanks a lot everybody.
I will try "Excelsior JET". If it's OK, maybe I"ll even purchase one.

excelsior JET still uses the wrapper exe method for anything involving a AWT or Swing. If these applications are just command line stuff, then you will be fine, it will compile to a straight exectuable. Otherwise, the user will still have to install a JVM.

Share this post


Link to post
Share on other sites
There is a way in JSmooth to include the JVM/JRE within the application. The only problem with this is that it is 15mb bigger, and of course isn't cross platform, and doesn't get updated with new JVM updates...

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!