These days I searched and posted on the Internet to find out how to solve the problem of not valid JDK isntalled, but there was no result. This uses ant for release, and the JDK version cannot exceed 1.7. I installed the latest jdk1.8 on the Mac, so this error is always reported during the release. How to solve this problem: 1. Download a JDK of version 1.7; (OR) 2. Use the JDK of version 1.6 that comes with the Mac machine. The best way is not to download it, next I will discuss the solution without downloading it:
Step 1: Run "terminal" and enter sudo nano ~ /. Bash_profile // obtain the permission to modify the. bash_profile file and add the following path. Export java_home =/system/library/Java/javavirtualmachines/1.6.0.jdk/contents/home // Add and save the file
Step 2: Return to the terminal and enter sudo nano ~ //. Bashrc // Add the following code
Export java_6_home =/system/library/Java/javavirtualmachines/1.6.0.jdk/contents/home
Export java_8_home =/library/Java/javavirtualmachines/jdk1.8.0.jdk/contents/home
// Add and save the file
Step 3: Return to the terminal and enter source ~ /. Bash_profile
Enter source ~ /. Bashrc
These two steps are the modified content.
Step 4: Go to the project directory on the terminal and enter
Cocos run-p Web-M release
Congratulations! Release !!!
[Mac] Not valid JDK isntalled --- high JDK version causes release failure