Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Server VM needed but not available in JRE. Then what package do I need: JRE, JDK?

This is the context: I've just developed an app that needs to be launched in SERVER mode (java -server). I'm using the JSE SDK (JDK) and I have no problems to run the app because the JDK has the Server VM. Now, I'm trying to create an installer that way people will be able to install this app in their computers. But at this point I've noticed this:

The JRE that most users have installed (in order to run java apps), doesn't have the Server VM, so my app won't run. Due to this, my question is:

  • Is there any way to add the Server VM to the already installed JRE???
  • For those users that don't have java installed...what package should I suggest to install? JDK or JRE?

I'm a little bit a confused...not sure what packages have the Server VM or not.

like image 254
testk Avatar asked Oct 14 '10 17:10

testk


3 Answers

You can optionally include the server HotSpot VM with a redistributed copy of the JRE. The 'jre\bin\server\' directory within the private JRE for the JDK contains the HotSpot Server VM. It is permissible to include this with distributions of the JRE provided you follow the requirements laid out in the JDK README.

From the JDK 7 README:

On Microsoft Windows platforms, the JDK includes both the Java HotSpotTM Server VM and Java HotSpotTM Client VM. However, the JRE for Microsoft Windows platforms includes only the Java HotSpotTM Client VM. Those wishing to use the Java HotSpotTM Server VM with the JRE may copy the JDK's jre\bin\server folder to a bin\server directory in the JRE. Software vendors may redistribute the Java HotSpotTM Server VM with their redistributions of the JRE.

http://www.oracle.com/technetwork/java/javase/jdk-7-readme-429198.html#jre (Retrieved 9/22/2012)

like image 136
polymathcoder Avatar answered Oct 06 '22 01:10

polymathcoder


Just use the client mode.

You are not going to find a good solution. You could suggest that they all install the JDK which has the server mode enabled, but your app should have a smoother delivery than that. If you were delivering your application to server guys, you could easily say that it needs to be run in server mode and let them handle it.

The server mode is an optimization to trade start-up time for long-duration speed improvements. It shouldn't be required for any application, especially one which is going to be delivered to client machines.

like image 33
Erick Robertson Avatar answered Oct 06 '22 01:10

Erick Robertson


Private vs. public JRE - Installing the JDK installs a private Java SE Runtime Environment (JRE) and optionally a public copy. The private JRE is required to run the tools included with the JDK. It has no registry settings and is contained entirely in a jre directory (typically at C:\Program Files\jdk1.6.0\jre) whose location is known only to the JDK. On the other hand, the public JRE can be used by other Java applications, is contained outside the JDK (typically at C:\Program Files\Java\jre1.6.0), is registered with the Windows registry (at HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft), can be removed using Add/Remove Programs, might or might not be registered with browsers, and might or might not have java.exe copied to the Windows system directory (making it the default system Java platform or not).

JDK Installation and troubleshoot.

like image 38
michael Avatar answered Oct 05 '22 23:10

michael