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

3

5

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.

Meltage answered 14/10, 2010 at 17:45 Comment(2)
why do you need the server vm?Childbearing
Because it is a server application and the performance will be betterMeltage
A
6

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)

Aesculapian answered 22/9, 2012 at 17:2 Comment(0)
S
3

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.

Supervene answered 14/10, 2010 at 18:21 Comment(2)
There are plenty of optimisations that haven't been ported to the client VM. Client applications can certainly benefit from them.Hyperostosis
Benefit and requirement are two different things.Supervene
M
1

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.

Middy answered 15/8, 2011 at 15:17 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.