I am running a program that utilizes Scala 2.10 for work and is not compatible with Java 8, only Java 7. In a Windows 7 command line, how can I set the java path to use Java 7 ONLY for that directory?
You may create 2 batch file one for java 7 and one for java 8 like this -
jdk7.bat
@echo off
echo Setting JAVA_HOME
set JAVA_HOME=C:\Program Files\Java\jdk1.7.0_11
echo setting PATH
set PATH=C:\Program Files\Java\jdk1.7.0_11\bin;%PATH%
echo Display java version
java -version
jdk8.bat
@echo off
echo Setting JAVA_HOME
set JAVA_HOME=C:\Program Files\Java\jdk1.8.0_11
echo setting PATH
set PATH=C:\Program Files\Java\jdk1.7.8_11\bin;%PATH%
echo Display java version
java -version
You may quickly switch between them running these batch file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With