[Mac] Not valid JDK isntalled --- high JDK version causes release failure

Source: Internet
Author: User
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.