How to run the JDK, given new security?

In my Terminal, I run:


~/Java/jdk-12.0.1.jdk/Contents/Home/bin/java -version


I get a popup that says: “jdk-12.0.1.jdk” can’t be opened because its integrity cannot be verified.

This software needs to be updated. Contact the developer for more information.


Is there some way to mark this as a security exception?


If I go to System Preferences > Security & Privacy > General, I see that it was just blocked. If I click "Open Anyway", it opens the "jdk-12.0.1.jdk" folder in finder, but does not change the result above.

I'm no security expert, but I've used the JDK a lot (from beta 5 through beta 7). I have not had problems running JDKs that I've installed via packages downloaded from java.oracle.com:



makoto ~ % /usr/libexec/java_home -V

Matching Java Virtual Machines (3):

11.0.4, x86_64: "Java SE 11.0.4" /Library/Java/JavaVirtualMachines/jdk-11.0.4.jdk/Contents/Home

1.8.0_221, x86_64: "Java SE 8" /Library/Java/JavaVirtualMachines/jdk1.8.0_221.jdk/Contents/Home

1.7.0_80, x86_64: "Java SE 7" /Library/Java/JavaVirtualMachines/jdk1.7.0_80.jdk/Contents/Home


/Library/Java/JavaVirtualMachines/jdk-11.0.4.jdk/Contents/Home

makoto ~ %

makoto ~ % java -version

java version "11.0.4" 2019-07-16 LTS

Java(TM) SE Runtime Environment 18.9 (build 11.0.4+10-LTS)

Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.4+10-LTS, mixed mode)



I've also had success running apps that bundle their own JRE/JDK (e.g. Moneydance, IntellIJ Idea).


Perhaps the JDK install needs to be installed with a signed package or part of a signed application? Anyway, I hope this helps...

You can manually remove the quarantine flags from the folder with:


xattr -d com.apple.quarantine /Library/Java/JavaVirtualMachines/jdk-12.0.1.jdk


or wherever you have installed your JDK.

How to run the JDK, given new security?
 
 
Q