Is it advisable to have more than 1 JRE on a server ?

Posted on 2012-03-16
Last Modified: 2012-03-22
Is it advisable to have more than 1 JRE on a server ?

We have Linux box which has a bunch of existing applications . We have 1.4 JRE Installed
on it and some of the scripts use it . We have a new application that needs to be
built .But this new application needs 1.6 JRE .

My question is

1.Is it advisable to have more than 1 JRE installed and have my application point to that

2.If we are to upgrade to 1.6 whats the risk of breaking the existing applications

3.I am confused on whether to follow option 1 or 2 .which is the standard one ?
Question by:Shaunsmith
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7

Accepted Solution

n4th4nr1ch earned 100 total points
ID: 37731057
It is advisable as long as you understand how to manage it.
alternatives is a command which you can use to manage multiple JREs on the same machine.
Linux doesn't have a problem with this, it's more of a human problem: how much confusion can you handle?
LVL 47

Assisted Solution

for_yan earned 400 total points
ID: 37731060
If you are talking about standlaone applications - you can have as many JDK's or JRE's on the server as you want - and make sure that you PATH when you start each application has your prefereble JRE_HOME/bin closer to the top of the path.

If you are running some servlet container - say Tomcat - then of coues all your J2EE applications will run in the JVM with which you strat your container
LVL 47

Expert Comment

ID: 37731063
There is no standard decision there - it all depends on your particular situation and type of applications and so on.
to have several JRE's is not uncommon
Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

LVL 47

Expert Comment

ID: 37731067
Java is rather cinsistently downward compatible - so you should not expect many problems when mnoving to Java 6 from older versions of Java. still if you have big applications with lots of classes then you should test caredfully before moving - there may be some small details which would feel differently, so you want to be careful.
With samll applications probability of problems is natural;lly much less
LVL 47

Expert Comment

ID: 37731070
Also if your applications are server type dioing mostly back-end work then probability of problems moving to newer Java will be less; the GUI part more probably will have some differenceas
LVL 47

Expert Comment

ID: 37731077
If you happpen to recompile some parts of code on the newer java - you may see some deprecated warnings - although it is not bad to understand why these warnings appear in particular cases, you still should not worry too much about them, as in great majority of cases deprecated methods and functionality in the later version of java is still working as before, so do not panic about it, and rather not change the code because of these warnings - kit will mostly cause you more problesm if you change
LVL 47

Expert Comment

ID: 37731089
If you have different versions of java and several JAVA_HOME/bin paths will be present on your path and if you are going to compile some pieces of code, I would warn you rather not to mix both JRE's and JDK's in this way - make sure have all of them JDK if you really need to recompile some part. Otherwise you may sometimes encounter cases difficult to diagnose when you happen to run compilation with Java version later than the one with which you run the applications (java -version may happen to be older than javac -version - this will cause problems)

Author Comment

ID: 37739676
Thank You for your answers . I think I will go with the option of installing a new version of Java in a seperate path so as not to disturb the existing applications

I have one more question . Do I install a JDK or a JRE ? My application is a simple standard java application that will be run on the command line and was wondering if there is any advantage or disadvantage to do either one of them
LVL 47

Expert Comment

ID: 37739716
If you are going to do compilation or use some development tool on the machine then always install JDK's on that machine. If you are sure you'll never need to compile then install  JRE's on that machine.

for Tomcat prior to 5.5 the JDK was required to compile JSP's
The later versions of Tomcat carry compiler with their own installation so they
can work with JRE.

So whne you run java command it does not matter whether it comes form JRE or JDK.

Featured Post

Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
pvcreate issue 5 100
Understanding ping command in Ubuntu 5 64
ossec: how to extend rules 1002 and 1003 2 46
Bitcoin mining - Is it possible? 6 99
In this post we will learn different types of Android Layout and some basics of an Android App.
Join Greg Farro and Ethan Banks from Packet Pushers ( and Greg Ross from Paessler ( for a discussion about smart network …
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
The viewer will learn how to implement Singleton Design Pattern in Java.
Suggested Courses

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question