When I type " java -version
" into the terminal it says :
"Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)"
But when I open my system preferences and try to click on Java is says:
"“Java” can’t be opened because it isn’t available."
I don't know what that means but the real problem is that when I try to run/open some .jar files a pop-up comes up saying that this java file can't be opened check the console.
Why is this happening?
Looks like java
is not installed on your machine.
From the docs , you can check if java is installed, the following way:
Mac OS X 10.6 and below: Apple's Java comes pre-installed with your Mac OS.
Mac OS X 10.7 (Lion) and above: Java is not pre-installed with Mac OS X versions 10.7 and above. To get the latest Java from Oracle, you will need Mac OS X 10.7.3 and above. If you have Java 7 or later versions, you will see a Java icon under System Preferences . Java versions 6 and below are listed in the Java Preferences.app located in the Applications > Utilities folder on your Mac.
You can find the java installation instruction for Mac here .
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.