Title: How to change Java Version/JAVA_HOME for Ant? | Darshit Patel's Blog
Open Graph Title: How to change Java Version/JAVA_HOME for Ant?
X Title: How to change Java Version/JAVA_HOME for Ant?
Description: Learn how to change the Java version for Ant builds using the ~/.antrc file on Unix systems. Step-by-step guide for switching JAVA_HOME per-project.
Open Graph Description: Learn how to change the Java version for Ant builds using the ~/.antrc file on Unix systems. Step-by-step guide for switching JAVA_HOME per-project.
X Description: Learn how to change the Java version for Ant builds using the ~/.antrc file on Unix systems. Step-by-step guide for switching JAVA_HOME per-project.
Keywords:
Opengraph URL: https://darshit.dev/posts/change-java-version-ant/
X: @darshitpp
Generator: Hugo 0.169.0
Domain: darshit.dev
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Posts","item":"https://darshit.dev/posts/"},{"@type":"ListItem","position":2,"name":"How to change Java Version/JAVA_HOME for Ant?","item":"https://darshit.dev/posts/change-java-version-ant/"}]}
{"@context":"https://schema.org","@type":"BlogPosting","headline":"How to change Java Version/JAVA_HOME for Ant?","name":"How to change Java Version\/JAVA_HOME for Ant?","description":"Learn how to change the Java version for Ant builds using the ~/.antrc file on Unix systems. Step-by-step guide for switching JAVA_HOME per-project.","keywords":["java","linux","ant"],"articleBody":"I wrote this earlier on a Github gist, but putting it here for a consolidated reference.\nWant to change Java Version/JAVA_HOME for Ant builds? Open ~/.antrc file by running vim ~/.antrc Add JAVACMD=/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.\nThe wrapper scripts use the following environment variables (if set):\nJAVACMD—full path of the Java executable. Use this to invoke a different JVM than JAVA_HOME/bin/java(.exe). ANT_OPTS—command-line arguments that should be passed to the JVM. For example, you can define system properties or set the maximum Java heap size here. ANT_ARGS—Ant command-line arguments. For example, set ANT_ARGS to point to a different logger, include a listener, and to include the -find flag. Note: If you include -find in ANT_ARGS, you should include the name of the build file to find, even if the file is called build.xml. Source: https://ant.apache.org/manual/running.html\n","wordCount":"188","inLanguage":"en","image":"https://darshit.dev/og-image.png","datePublished":"2020-06-15T10:40:40+05:30","dateModified":"2020-06-15T10:40:40+05:30","author":{"@type":"Person","name":"Darshit Patel"},"mainEntityOfPage":{"@type":"WebPage","@id":"https://darshit.dev/posts/change-java-version-ant/"},"publisher":{"@type":"Person","name":"Darshit Patel's Blog","logo":{"@type":"ImageObject","url":"https://darshit.dev/favicon.ico"}}}
| None | IE=edge |
| author | Darshit Patel |
| theme-color | #2e2e33 |
| msapplication-TileColor | #2e2e33 |
| og:site_name | Darshit Patel's Blog |
| og:locale | en |
| og:type | article |
| article:section | posts |
| article:published_time | 2020-06-15T10:40:40+05:30 |
| article:modified_time | 2020-06-15T10:40:40+05:30 |
| og:image | https://darshit.dev/og-image.png |
| twitter:card | summary_large_image |
| twitter:image | https://darshit.dev/og-image.png |
Links:
Viewport: width=device-width,initial-scale=1,shrink-to-fit=no
Robots: index, follow