Solved

Java - Can I install two different versions of Java

Posted on 2015-01-08
8
141 Views
Last Modified: 2015-01-21
I have a a Win 7 machine with two applications that need different versions of Java,  an older program that won't run under the new Java and a newer program that won't run under the older version ....    Is it possible to run two different versions of Java ?    Is there another way I should be approaching this problem ?

Thanks ...

Joel
0
Comment
Question by:jtbrown1111
[X]
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
  • 3
  • 2
  • 2
  • +1
8 Comments
 
LVL 95

Expert Comment

by:John Hurst
ID: 40538285
Can you install two different versions of Java?  Yes you can. I do not, so you will need to look at the install and put it in a different Java folder. Then look at Control Panel, Programs and Features and see that both are installed.

 an older program that won't run under the new Java and a newer program that won't run under the older version

You will have to find a way to point the older program to the older version. It should find it and work, but there is no guarantee.
0
 
LVL 27

Expert Comment

by:dpearson
ID: 40538994
What you need is a small batch file that you use to launch the old program.

That batch file should:
 - set the JAVA_HOME environment variable to the old version of Java.
 - add the old version of Java to the front of the PATH environment variable
 - then launch the old program

This way when it's launched it will have JAVA_HOME set to the old version of Java and it will find the old version of Java first on the path and run that version.

All other Java programs will continue to use the newer version of Java (assuming you set up the system environment variables to point to the new version of Java - which the Java installer will normally do for you).

Doug
0
 
LVL 21

Expert Comment

by:Amitkumar Panchal
ID: 40539374
Yes, Agree with both the experts.

I have java 5, 6, 7 & 8 installed in my machine and working fine. So two diff versions of java will not be an issue. Please follow the instruction mentioned by experts, you are done.
0
RoboForm Secure Password Management System

RoboForm Everywhere - Superb Browser Support
Windows / Apple / IOS / Android / Linux / Chrome OS
Use different complex passwords everywhere
Best Secure Password Management by far
Synchronize all of your devices instantly
Safe, Secure & Highly Recommended!

 

Author Comment

by:jtbrown1111
ID: 40539380
Does anyone have a sample batch file ?
0
 
LVL 95

Assisted Solution

by:John Hurst
John Hurst earned 100 total points
ID: 40539416
Here is a Microsoft Technical article on setting the Environment variables.

https://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/sysdm_advancd_environmnt_addchange_variable.mspx?mfr=true

That should allow you to set the older variable.

Now old versions of Java are insecure. I am using version 8u25 and only that version. You should check with the program vendors about updating Java as they really need to get up to date.
0
 
LVL 27

Accepted Solution

by:
dpearson earned 400 total points
ID: 40539601
The batch file should look something like this:

set JAVA_HOME=c:\java\jdk32_1.7.0_55
set PATH=c:\java\jdk32_1.7.0_55\bin;%PATH%

@REM This is where we launch your old Java program using the old version of Java
java -jar c:\myold\javaprogram.jar

Open in new window


Assumes you installed Java 1.7 32-bit into "c:\java\jdk32_1.7.0_55" - as an example.

BTW you'll find your life is MUCH easier in Windows if you don't install it to the default location where the path will contain spaces like "c:\Program Files\..." as then you need to put quotes around everything and it gets messy.

(If you already installed it there, just uninstall and re-install to a path with no spaces).

Hope that helps,

Doug
0
 

Author Comment

by:jtbrown1111
ID: 40539606
@ Doug,

Thank you ......    Assuming the command to run my application is the following how would line 5 change ?


 C:\EPS\EasyPay\JEPS.exe -cp "./custom;../Util/AbsoluteLayout.jar;../Util/jtds-1.2.jar;../Util/J2PrinterWorks.jar;../EPSTIP/EPSTIP.jar;CCM.jar" ccm.CCM
0
 
LVL 27

Expert Comment

by:dpearson
ID: 40539610
Hmm - that may be tricky because JEPS is (I believe) a custom executable that EasyPay has put together.  That's not the standard way to do Java programs, so it's hard to be sure how it works.

However, on the plus side the list of jar files and other parameters looks like more normal Java.

I'd try just using the complete path as you have it there (after setting PATH and JAVA_HOME) and see if that works.
I'm afraid if that fails, you may need to contact the EasyPay folks directly to ask them - since unfortunately they can override whatever they want inside that JEPS.exe executable.

Doug
0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
VPN  services - questions and recommendations 7 59
Java array sort 10 63
YouTube - Convert audio file to video 8 103
Users lost folder redirection after patch was installed. 7 50
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
If you get continual lockouts after changing your Active Directory password, there are several possible reasons.  Two of the most common are using other devices to access your email and stored passwords in the credential manager of windows.
This Micro Tutorial will give you basic overview of the control panel section on Windows 7. It will depth in Network and Internet, Hardware and Sound, etc. This will be demonstrated using Windows 7 operating system.
This Micro Tutorial will give you a introduction in two parts how to utilize Windows Live Movie Maker to its maximum editing capability. This will be demonstrated using Windows Live Movie Maker on Windows 7 operating system.
Suggested Courses

751 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