Issue
I am using Elasticsearch which uses Java 8. I also want to install kafka on the same machine but kafka uses java 11. Both services are to be run in parallel. Can anyone tell how can I run both java versions at same time?
Solution
- Manually download and unpack Java
- https://adoptium.net/releases.html?variant=openjdk11
- https://www.azul.com/downloads/?version=java-17-lts&os=windows&architecture=x86-64-bit&package=jre
- Instead of simply starting java with the
java -args
commandline,- you can start it via
/install/path/to/java/bin/java -args
- or, for windows, use
C:\install\location\bin\java.exe -args
You might want to make some start scripts / batch files for that, depending on the exact requirements of your system and Elasticsearch and kafka and possibly other software.
That's it.
one little addition:
If you can NOT directly call java, or the software starts more java apps via the 'default' java, you can also use scripts to manipulate the PATH variables of your system before starting the app. Then you (and your apps) can simply call java -args
again.
Answered By - JayC667
Answer Checked By - Clifford M. (JavaFixing Volunteer)