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

2

5

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???!

Lebna answered 16/11, 2021 at 14:18 Comment(12)
Can you execute java --version on the command line? If so, try where java.Purington
If he want to set up JAVA_HOME i guess java XXX command will not be available, am i wrong?Alurta
@Alurta possibly. But PATH and JAVA_HOME are separate environment variables, so maybe PATH is set.Purington
baeldung.com/java-check-is-installed "as with java -version, this command is only useful if our PATH environment variable points to the bin directory."Urticaria
java -version will work without JAVA_HOMEUrticaria
This might help: baeldung.com/java-home-on-windows-7-8-10-mac-os-x-linuxUrticaria
Does this answer your question? superuser.com/questions/1148677/…Urticaria
What distribution of Java did you install? AdoptOpenJDK/Temurin (old adoptopenjdk)/ORACLE JDK... ? Maybe post a site from which you downloaded Java. Installations of different JDK's / JRE's can have different paths.Alurta
I think the superuser question might have answered it. I checked Java control panel, which shows that it's actually in C: > ProgramData > App-V > 758738 > 3232234 > Root > VFS > ProgramFilesX86 for some reason.Lebna
Strangely enough CMD did not work - entering "where java" brought back "INFO: could not find files for the given pattern".Lebna
Because its in program data, which is hidden, I can't use it to set up JAVA_HOME. Does anyone know if I can just move the Java folder elsewhere? Straight into my C: Program files x86? Without it messing anything else up?Lebna
Please, use your APP-V client! ...then you (probably) can: java -version, where java, ...Dealt
D
8
Dealt answered 16/11, 2021 at 14:26 Comment(4)
java_home is java_home, but this "solution" considers %PATH% only !;)Dealt
when I do "where java" in cmd I just get "INFO: could not find files for the given patterns"Lebna
it means: it is not on/your installer didn't (successfully) modify the %PATH% ... App-V: doesn't that mean that you are/use java in a "virtual environment"!? ;) social.technet.microsoft.com/Forums/en-US/…Dealt
(get-command java.exe).Source also works.Striker
N
6

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.

enter image description here

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.

Nutriment answered 16/11, 2021 at 14:53 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.