user3016945
user3016945

Reputation: 265

Need to use two Java versions in one machine

My application will support only java 1.6 version and I need to execute all test cases using java 1.7 compiled class files code.

My question how to reach above requirement...

  1. Is it possible to install both java 1.6 and java 1.7 versions in my machine?
  2. If possible how can i set java 1.6 path for my application and how i can set path for java 1.7 version to execute test cases using java 1.7 compile files.

Application will not open with Java 1.7, but I need to use java 1.7 compiled files only.

Upvotes: 0

Views: 2142

Answers (3)

Peter Lawrey
Peter Lawrey

Reputation: 533530

Like any program, you need to specify the directory of the program you want to run, either directly by giving the full path name, or indirectly by setting an environment variable like PATH or JAVA_HOME OR JDK_HOME

You can install any number of updates/versions of Java until you run out of disk space. To configure each program to use a specific version you need to look at how they are started and set appropriate directory to use Java from for that program.

Upvotes: 0

Sujith PS
Sujith PS

Reputation: 4864

Yes it is possible.

You can install multiple java versions in single system.

To make it simple. You can use eclipse , or Netbeans IDE. In that you can use different java versions to compile.

Upvotes: 0

pratim_b
pratim_b

Reputation: 1200

Yes , it is possible. You need to change JAVA_HOME environmental variable. You can set it in the script that is used to start the application.

This article might help you

Upvotes: 2

Related Questions