Back to Blog
Java update alternatives6/21/2023 If you want to update selections for all of the Java tools in one go try the following replacing the package name with one of your choice: $ sudo update-java-alternatives -s java-1.8. Javadoc auto /usr/lib/jvm/java-7-openjdk-amd64/bin/javadocĪs shown above here java would run from version 8, and javac from version 7. Javac auto /usr/lib/jvm/java-7-openjdk-amd64/bin/javac Bagaimana cara memeriksa versi Java saya Ketik java -version ke Command Prompt, lalu tekan Enter pada keyboard Anda. Java manual /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java ‘ Ini akan secara otomatis mengambil versi Java 8 yang tersedia dan mengaturnya menggunakan perintah update-java-alternatives. This one an overview of the Java tools and which version will be used, e.g.: $ update-alternatives -get-selections | grep java In addition to what said, this command will show you all Java packages installed on the system, e.g.: $ update-java-alternatives -l Otherwise I wonder why executing the binary inside my 1.8 jdk folder gives me the version 1.6. Other question: What does javac do? Is it executing its code directly or depending on other binaries in the system? If so the link for them could be broken. Preprending /Library/Java/JavaVirtualMachines/jdk1.8.0_40.jdk/Contents/Home/bin/ to the $PATH variable didn't change the output for javac -version either. usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/mysql/bin:/opt/X11/bin:/usr/local/git/bin:/Developer/Tools/Panda3DĮcho $JAVA_HOME (since I set it already in order to get javac to work) Neither did sym linking the javac inside /usr/bin to the javac in my jdk folder.Īny ideas how to get javac to use my 1.8 version ? Sym linking the CurrentJDK folder in "/System/Library/Frameworks/amework/Versions/" to the jdk folder in Library didn't change anything. I have the 1.8 jdk installed under "/Library/Java/JavaVirtualMachines/jdk1.8.0_40.jdk", but even when I run /Library/Java/JavaVirtualMachines/jdk1.8.0_40.jdk/Contents/Home/bin/javac -version it gives me "javac 1.6.0_29". ![]() When I run javac -version it gives me "javac 1.6.0_29". I'm trying to compile a jar on my mac using 1.8 as a target release, but javac fails with the message "invalid target release".
0 Comments
Read More
Leave a Reply. |