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

Example Analysis of multiple JDK and switching versions in java

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

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

This article analyzes "sample Analysis of multiple JDK and switching versions in java". The content is detailed and easy to understand, and friends who are interested in "sample analysis of multiple JDK and switching versions in java" can follow the editor's train of thought to read it in depth. I hope it will be helpful to everyone after reading. Let's follow the editor to learn more about "sample analysis of multiple JDK and switching versions in java".

Preface

Install multiple JDK and switch versions at any time

Download and install JDK

I use JDK8 and JDK11 to demonstrate here.

Download from the official website: https://www.oracle.com/java/technologies/downloads/

Download and install it.

2. Configure JDK

1. System variable

Create a new variable in the system variable with the variable name JAVA_HOME,JAVA_HOME11,JAVA_HOME8 as shown in the figure:

Here, the variable value of JAVA_HOME11,JAVA_HOME8 is the path where you install JDK8 or JDK11, just go to that directory level, and so is JDK8, as shown in the figure:

Then set the variable in Path and add% JAVA_HOME%\ bin;%JAVA_HOME%\ jre\ bin

It's best to add it to the front, because after installing JDK11, a variable will be generated, which is higher than the variable you set by yourself. You need to move our newly added variable to C:\ WINDOWS after you create it (at the bottom after it is created, and move it up through the right-hand move button). C:\ Program Files (x86)\ Common Files\ Oracle\ Java\ javapath and C:\ Program Files\ Common Files\ Oracle\ Java\ javapath and C:\ WINDOWS\ System32 variables.

* * must do: * * another thing to note is that you need to delete the files in the following images in the C:\ Program Files (x86)\ Common Files\ Oracle\ Java\ javapath (or C:\ Program Files\ Common Files\ Oracle\ Java\ javapath) directory. Please note that only these three files are deleted, as shown in the figure:

If the following picture is like this, it will not be deleted.

After deletion, pass the command.

Javac-version and java-version to see if they match.

If you want to change the version, you only need to modify the value in the JAVA_HOME variable

To change to the JDK8 version, change the value of the JAVA_HOME variable to% JAVA_HOME8%

To change to the JDK11 version, change the value of the JAVA_HOME variable to% JAVA_HOME11%

After modification, you need to reopen cmd and check it with javac-version and java-version to see whether the modification is successful.

What are the basic data types of java? the basic data types of Java can be divided into: 1. Integer types, which are used to represent the data types of integers. 2. Floating point type, which is used to represent the data type of decimals. 3. Character type. The keyword of character type is "char". 4. Boolean type, which is the basic data type that represents logical values.

This is the end of the sample analysis of multiple JDK and switching versions in java. I hope the above content can improve everyone. If you want to learn more knowledge, please pay more attention to the editor's updates. Thank you for following the website!

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

Development

Wechat

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

12
Report