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
Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

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

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
Suggested Courses

635 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