Jump to content
  • Advertisement
Sign in to follow this  
sir_wojciech

[java] How to bundle JVM with your program?

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

Advertisement
What do I really have to do so my program won't need JRE installed... The exe4j lets you use your own jvm, but how do you create one?

Share this post


Link to post
Share on other sites
Quote:
Original post by sir_wojciech
What do I really have to do so my program won't need JRE installed... The exe4j lets you use your own jvm, but how do you create one?


This has been discussed a couple of times on the board, search for bundling jvm or java to exe for a bunch of threads. Essentially you can just -include- the entire jvm as part of your install. The source for java.exe is included with the JDK distributions, so you can change it and recompile it into a custom exe that launches just your jar or main class or whatever.

As long as you include the entire JVM theres no licensing issues (there are small bits you can legitimitely remove from the distrib, but not the hefty bits like the swing and AWT classes). So there is a hefty size penalty to pay. Some people (who shall remain nameless) have experimented with removing huge chunks of the JVM that they didn't need and distributed it that way and not attracted any attention from Sun, but its not recommended ...

D.

Share this post


Link to post
Share on other sites
I was thinking about writing my own install program in Java. The problem is it would be ran on JVM too, so what I basially need is a native program to start the JVM and then pass control to the setup program.

Now, hoping nobody will call me an idiot, but where is the source code for java.exe ? I see there's a src.zip file in the j2sdk directory but it includes the source for the classes used in Java, not java.exe itself. I have Java 1.4.2

Share this post


Link to post
Share on other sites
Quote:
Original post by gcsaba2
I was thinking about writing my own install program in Java. The problem is it would be ran on JVM too, so what I basially need is a native program to start the JVM and then pass control to the setup program.

Now, hoping nobody will call me an idiot, but where is the source code for java.exe ? I see there's a src.zip file in the j2sdk directory but it includes the source for the classes used in Java, not java.exe itself. I have Java 1.4.2


It should be in a directory called 'launcher' in the src.zip file. There ought to be an include directory aswell, either in the actual root of the JDK distrib or the src.zip file (I forget where exactly) which has include files you need to compile the thing.

D.

-edit-
also check out this link ...
http://java.sun.com/docs/books/tutorial/native1.1/invoking/index.html

-edit-

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!