Solved

Java - Can I install two different versions of Java

Posted on 2015-01-08
8
148 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 96

Expert Comment

by:Experienced Member
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 28

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
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 

Author Comment

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

Assisted Solution

by:Experienced Member
Experienced Member 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 28

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 28

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

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

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

Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
Possible fixes for Windows 7 and Windows Server 2008 updating problem. Solutions mentioned are from Microsoft themselves. I started a case with them from our Microsoft Silver Partner option to open a case and get direct support from Microsoft. If s…
This Micro Tutorial will teach you how to change your appearance and customize your Windows 7 interface to your unique preference. This will be demonstrated using Windows 7 operating system.
This Micro Tutorial will give you a basic overview of Windows DVD Burner through its features and interface. This will be demonstrated using Windows 7 operating system.
Suggested Courses

624 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