简体   繁体   中英

Change Java_Home Path in windows 10 without admin rights

I have a windows 10 laptop and I donot have admin rights. But there is already jdk 11 installed in my laptop with JAVA_HOME set in system variables. So one of my project does not compile with java 11 and I needed to install jdk 8 and I followed this instructions and installed it.

I have set the JAVA_HOME again in the user variables. But when I tried to see the version using java --version I could only see the jdk 11 that is set in system variables and I cannot see the jdk 8 that I installed in the C:/Users directory. So how can I set/change the JAVA_HOME for my maven project to build in git bash and run the spring boot app.

EDIT: note: I have also added the %JAVA_HOME%\\bin to User variables Path.

As suggested, you can add to the PATH the %JAVA_HOME%\\bin https://maven.apache.org/install.html

Then using the ff. command, verify what JDK version your maven using

mvn -v

you should see something like this

输出截图

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