Reputation: 21
I recently downloaded jdk 7u25 on my Mac (I run an OSX 10.7.5) for my java developers class. After downloading the .dmg file from Oracle at http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html and after successfully installing the package, I tried to open it at Library>Java>JavaVirtualMachines>jdk1.7.0_25.jdk>Contents>Home>MacOS>libjli.dylib
After opening on Terminal (default program), I got a short message looking like this:
/Library/Java/JavaVirtualMachines/jdk1.7.0_25.jdk/Contents/Home/jre/lib/jli/libjli.dylib ; exit;
-bash: /Library/Java/JavaVirtualMachines/jdk1.7.0_25.jdk/Contents/Home/jre/lib/jli/libjli.dylib: cannot execute binary file
logout
[Process completed]
I probably did something wrong here, but I have no way of finding out as all the FAQs on Oracle are extremely vague and basic, or all the answers on forums are beyond my knowledge of java.
I am very much a beginner, and I just want to run the same jdk on my laptop like I do at school so that I can take my work home.
Upvotes: 2
Views: 3947
Reputation: 821
After an JDK upgrade, e.g. from Homebrew then MacOS will warn, that it cannot open libjli.dylib, java and other binaries of the (Open)JDK.
Cause:
Apple adds to unsigned or wrongly signed software an attribute: com.apple.quarantine
, that prevents a file to be executed.
Solution: Remove the quarantine attribute from the file.
Example:
sudo xattr -r -d com.apple.quarantine /Library/Java/JavaVirtualMachines/graalvm-jdk-17
Explanation:
-r
- remove flag
-d
- name of the file attribute
The same applies to libjli.dylib
. Change to the directory and use the solution from above.
Source: iBoysoft - Cannot be opened because the developer cannot be verified?
Upvotes: 0
Reputation: 85
Go to Applications -> Utilties -> Terminal
On the command line type:
java --version
That will tell you the installed jdk version.
Upvotes: 1