• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
2
Question by superflyninja · Aug 31, 2016 at 11:43 PM · android buildjava

The path you specified does not look like a valid JDK installation

Hi all, Im tearing my hair out with this one. One day Im happily producing android builds, the next Im getting an error asking me to point to a valid JDK directory. I've wasted half a night trying to get it working again to no avail. I've tried adding the jdk path to the environment variable,restarted the pc etc,updated the jdk and nothing works. Can anyone please help???????????????????????????????????? EDIT: Im running 64bit. I tried both 64bit and x86 jdks. No luck

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by 3ddave · Sep 01, 2016 at 12:48 AM

You haven't provided many details about your configuration so I'll try to cover all the bases here. The path that will "look like" a valid JDK installation is as follows: jdk_1.8 <-- Point to this folder | bin | javaw.exe | javac.exe | include | jre | bin | javaw.exe | lib | lib When you find where to input the path it should be the top level jdk folder (not bin or jre).

There are several levels of "resolution" that are used to find the java installation, going from most specific to least specific (which is the search order) they are typically:

  • Application

  • User

  • System

Typically an application will allow you to specify the path directly in a settings menu, however some require you to specify the path before the application is started, either via configuration or system level path (you didn't specify what program you are using).

User and System will both roll up under "Environment" variables for windows (again, you didn't specify what operating system you are using). User environment variables will typically override what is set for the system variables of the same name. Typically, the Java installation will set the System level environment variables. Currently I have the following vars set which seem to work for most apps:

  • JAVA_HOME C:\Java\jdk_1.8.0_102\jre

  • JDK_HOME C:\Java\jdk_1.8.0_102

  • JRE_HOME C:\Java\jdk_1.8.0_102\jre -PATH %JAVA_HOME%;%JAVA_HOME%\bin;%JDK_HOME%;%JDK_HOME%\bin etc etc

Having the path include JAVA_HOME and JDK_HOME may be important for some applications to work correctly (note that I include both JAVA_HOME and JAVA_HOME\bin so I can access both folders directly). My JAVA_HOME does indeed point to the JRE, but I suspect pointing to the JDK would also work. Sometimes you need to swap the paths around before they work correctly for your target application.

You may need to restart after updating your environment before it fully takes effect. If you are installing a new version of Java, I would recommend you try to ensure no older unwanted versions are still installed. Make sure the version you do have installed is compatible with the application you are using. If you have auto-update enabled, Java may have updated behind the scenes without you knowing it.

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image superflyninja · Sep 01, 2016 at 08:19 AM 0
Share

Apologies for the lack of detail but I was frothing at the mouth in anger :D I'm on Windows 10 64bit and the latest Unity (5.point something). Ah I was setting user level environment variables. $$anonymous$$aybe that was my issue. Cheers, Ill compare my env vars to yours and see how it looks!

avatar image jakejolli · Apr 26, 2018 at 11:45 AM 0
Share

Also note that, for whatever reason, you have to restart your PC for java path updates to be taken into account by Unity.

I had my JAVA_HO$$anonymous$$E variable set to jdk\bin, and that's where Unity was looking for it. After realizing the mistake and changing JAVA_HO$$anonymous$$E just to the jdk root directory, Unity was still looking at jdk\bin. After restarting, everything worked fine. This was painful.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

57 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How to make Unity find JDK on my linux machine. 1 Answer

Unity and Android. How yo manage build pipelines? 1 Answer

How to expand UnityPlayerActivity java source file?,How to expand UnityPlayerActivity? 0 Answers

Issue building my game for Android 0 Answers

Grade build fail: Heap size 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges