How can I control the Java version used with Ammonite

232 Views Asked by At

In my Linux system I have several Java versions installed. How can I control the version used to launch an Ammonite script?

1

There are 1 best solutions below

0
On

The amm executable is a sh script. It searches java in the PATH. So you can change temporarily your PATH. In bash it can be done in this way:

PATH=/path/to/java myscript.sc argument1 argument2 ....