简体   繁体   中英

How do I find where Java is installed on Windows 10?

I recently installed Java (Java Runtime 1.8.121) to my machine. I need to set up JAVA_HOME and set the variable from the Java folder where it installed.

Everywhere I have looked online says the Java folder should be located in Program files (x86), however, it is nowhere to be found. Its not in program files (x86), not in program files. I wasn't able to choose a destination when it was installed as Software center was used. It simply completed the installation.

Can someone please help me find where the Java folder is so I can set up JAVA_HOME???!

Open a command prompt

type: wmic product where "Name like '%%Java%%'" get installlocation,Name

This command can take a minute to complete. But should return something like this.

在此处输入图片说明

Edit: The benefit of this command, is that it doesn't rely on any system environment variables. It searches for installed programs that have the word 'Java' in the name. It won't return extra files or locations.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM