Sets major to the value 15 (=Major version number), which you can use further. So you see JAVA_VERSION, which contains the version number.įor example, major=$(echo $JAVA_VERSION | cut -d. MODULES="java.base piler java.datatransfer java.xml java.prefs sktop java.instrument java.logging java.management java.naming java.rmi java.scripting java.sql java.smartcardio jdk.accessibility .ci jdk.management jdk.unsupported .compiler jdk.aot jdk.attach jdk.charsets jdk.compiler jdk.dynalink jdk.editpad jdk.httpserver jdk.jdeps jdk.jlink .compiler.management jdk.jartool jdk.javadoc jdk.jcmd jdk.jconsole jdk.jdi jdk.jfr jdk.jshell jdk.jsobject jdk.jstatd jdk.localedata jdk.net jdk.sctp jdk.zipfs" On Java 15 (Debian) it has as content: IMPLEMENTOR="Debian" Check if Homebrew installation using brew -v, you will get version if installed, otherwise you get ‘command not found’. ![]() #BASH MAC CHECK JAVA VERSION MAC OS#This returns 8 for Java 8 ( "1.8.0_151" etc), and 9 for Java 9 ( "9-Debian" etc), which should make it easier to do the further comparison.Ī file called release is located in $JAVA_HOME. The simplest way to install Maven on your Mac OS is using brew command ( brew install maven ), if already Homebrew installed on your machine. # 8 for 1.8.0_nn, 9 for 9-ea etc, and "no_java" for undetectedĮlif ] I wrote a bash function that should work for JDK 9 and JDK 10.
0 Comments
Leave a Reply. |
Details
AuthorWendell ArchivesCategories |