Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to switch windows between different versions of jdk

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

Jdk how to achieve different versions of switching windows, I believe that many inexperienced people do not know what to do, so this paper summarizes the causes of the problem and solutions, through this article I hope you can solve this problem.

In actual development, we may encounter different projects that need to use different versions of jdk for development. At this time, we need to install different versions of jdk to achieve different projects for jdk switching.

First of all, you can download different jdk versions according to your needs. I installed jdk1.6 (32-bit) and jdk1.7jdk1.8 in this place. Jdk can be downloaded and installed on the official website. After installation, configure the relevant environment variables, we will not repeat them here. After installation, we only need to change the configuration of java_home, as shown in the following figure. For convenience, here we configure the JAVA_HOME environment variables of different jdk to JAVA_HOME_1.6_x86,JAVA_HOME_1.7 and JAVA_HOME_1.8, and we only need to configure the JAVA_ home value of the current jdk environment variable to use the JAVA_HOME variable value of jdk. For example, now that I want to use jdk1.7, I'll change JAVA_HOME to% JAVA_HOME_1.7%,. In the same way, when I use jdk1.8, I just need to change jJAVA_HOME to% JAVA_HOME_1.8%.

After modifying the environment variables, you also need to modify the currently used version of jdk and open the control panel. Select java, click View, select the jdk version selected by the current system, and don't forget to click OK and Save.

If the java version is not switched at this time, please follow the next steps to continue

1. Delete the java-related runners in the C:\ Windows\ System32 directory

Listed as java.exe,javax.exe,javac.exe

If there is no relevant java program, please ignore

two。 Remove the shortcut icons for javapath and Java-related runners for C:\ Program Files (x86)\ Common Files\ Oracle\ Java\ javapath, C:\ ProgramData\ Oracle\ Java\ javapath (because references are configured in path)

If there is no relevant java program, please ignore

3. Removes the default started version of jdk from the registry (running regedit). The value of the CurrentVersion entry of Java Development Kit and the value of the CurrentVersion entry of Java Runtime Environment in HKEY_LOCAL_MACHINE\ SOFTWARE\ JavaSoft

(1) windows + R enter regedit

(2) find the value of the CurrentVersion entry of Java Development Kit in HKEY_LOCAL_MACHINE\ SOFTWARE\ JavaSoft and the value of CurrentVersion item of Java Runtime Environment

Modify these two default values to be empty.

Finally, run cmd and enter java-version

Here I modify the jdk version to 1.6, and successfully show that the java version is 1.6!

If there are commands that are not internal or external, check that the JAVA environment variable is configured correctly!

After reading the above, have you mastered how jdk can switch between different versions of windows? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report