- Open
~/.antrc
file by runningvim ~/.antrc
- Add
JAVACMD=<NEW_JAVA_HOME>/bin/java
and save
The Ant wrapper script for Unix will source (read and evaluate) the file ~/.antrc before it does anything. On Windows, the Ant wrapper batch-file invokes %HOME%\antrc_pre.bat at the start and %HOME%\antrc_post.bat at the end. You can use these files, for example, to set/unset environment variables that should only be visible during the execution of Ant.
>The wrapper scripts use the following environment variables (if set):