Tag Archives: JDK switching

The problem of MAC switching JDK version and RN Android JDK version leads to compilation failure. Solve it

Make notes and notes.
refer to this
https://www.cnblogs.com/luodengxiong/p/5736806.html
How to install multi version JDK and switch under mac

Recently, I ran the old Android project and installed multiple JDK versions… Automatically installed by the as,
as a result, the Android version of the RN project reported an error. The main reason is that JDK 1.8
is required due to the problem of JDK Version (originally 1.8, openjdk 1.6 is automatically installed due to the old project…)

* What went wrong:
Could not initialize class org.codehaus.groovy.runtime.InvokerHelper

View the current version of JDK

/usr/libexec/java_home -V

If you need to switch the JDK version, just use 1.8.
refer to this for details

Install multi version JDK and switch several methods under MAC
personal use is. Bash_ The configuration mode of profile file is also convenient for switching in the future

It should be noted that after I switch, it still doesn’t take effect, and NR still can’t run,
finally enter the path of openjdk 1.6 and delete it