I use some programs that have known bugs when using Java 1.7.x (default on my computer), issues that would be fixed using Java 1.6. However I also use program that works fine with the default Java and have known issues with older versions.
How can I run the program myprogram
specifing the version of Java to use?
export JAVA_HOME='pathtojavaversionbin'
– lucacerone Dec 16 '14 at 10:24echo $PATH
? Append it to the question as additional details - in a comment, it is not very readable. – Volker Siegel Dec 16 '14 at 11:09JAVA_HOME
doesn't strictly need to be exported.JAVA_HOME='pathtojavaversionbin' /path/to/command
works fine – Auspex May 29 '19 at 15:11