Jump to content
  • Advertisement
Sign in to follow this  
Zyndrof

Executing Java-code?

This topic is 4400 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

It seems very complicated to execute Java-code and create .exe-files. Isn't there an easier way? Since I'm using an IDE (Netbeans 5.0) that's able to compile my code, shouldn't it be able to execute it too?

Share this post


Link to post
Share on other sites
Advertisement
java uses a byte code and doesn't naturally create machine code exes. but you can use third party programs such as: http://www.thisiscool.com/gcc_mingw.htm to make exes that store javas virtual machine inside them with a slight overhead

Share this post


Link to post
Share on other sites
So you're saying, that on the command line, this:

>MyApp.exe

Is much more complicated than this:

>java MyApp

I don't know about Netbeans, but Eclipse has a console from which you can run your programs. As for turning programs into .exe's - in Java you turn them into executable jar files.

If you get stuck post in this thread, and I'll try and help you out.

Jon

Share this post


Link to post
Share on other sites
Quote:
Original post by bgilb
java uses a byte code and doesn't naturally create machine code exes. but you can use third party programs such as: http://www.thisiscool.com/gcc_mingw.htm to make exes that store javas virtual machine inside them with a slight overhead


If that's the case, shouldn't Java have a format that suits it and will start the program without you having to use the command window?

Share this post


Link to post
Share on other sites
its not about being more complicated its about whats more convient for the end user and sadly lots of people have no clue what a jar file is.

Share this post


Link to post
Share on other sites
Quote:
If that's the case, shouldn't Java have a format that suits it and will start the program without you having to use the command window?


it does. jar files like polly said.

Share this post


Link to post
Share on other sites
If JRE is set up right double clicking on an executable jar file should run it. Unfortunately some mobile phone software interferes with this set up, Nokia PC Suite in particular.

Share this post


Link to post
Share on other sites
Quote:
Original post by pkelly83
If JRE is set up right double clicking on an executable jar file should run it. Unfortunately some mobile phone software interferes with this set up, Nokia PC Suite in particular.


I see :)

It just seems like so many steps to create a .jar file :/

Share this post


Link to post
Share on other sites
But thats a problem for programmers; not end users. Read the link I posted, it's really not that hard, and will probably take you less time than you think.

You just have to create a manifest file saying in which class your main method is, jar it up with your class files, and thats it.

Jon

Share this post


Link to post
Share on other sites
Quote:
Original post by polly
But thats a problem for programmers; not end users. Read the link I posted, it's really not that hard, and will probably take you less time than you think.

You just have to create a manifest file saying in which class your main method is, jar it up with your class files, and thats it.

Jon


Okay, thank you!

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!