MAC Get the system version and model

2023-01-23   ES  

1: Download jdk-7u9-linux-i586.tar.gz Put it in the formulation directory;

2: Open the terminal in this directory, execute the following commands to execute the following commands under/usr/lib to create a new JDK decompression directory JVM:

[java] view plaincopy

sudo mkdir /usr/lib/jvm

3: Unzip the JDK file to/usr/lib/jvm directory:

[java] view plaincopy

sudo tar zxvf jdk-7u9-linux-i586.tar.gz -C /usr/lib/jvm

4: Set environment variables such as java_home and classpath:

[java] view plaincopy

sudo gedit /etc/environment

Add the following content under this file:

[java] view plaincopy




5: If the PATH exists, use the colonary to separate the JDK BIN directory address. This way, the environment variables of the Java will be configured successfully, but the default JDK may not be installed by us because of Ubuntu, because Ubuntu There may also be the default JDK, such as OpenJDK; so in order to make the default use of the JDK we installed, the following commands need to be executed:

[java] view plaincopy

sudo update-alternatives –install /usr/bin/java java /usr/lib/jvm/jdk1.7.0_09/bin/java 300

sudo update-alternatives –install /usr/bin/javac javac /usr/lib/jvm/jdk1.7.0_09/bin/javac 300

sudo update-alternatives –config java

6: After the command is successfully executed, the JDK we installed is the system default. The execution command java -Version can successfully see the relevant information of JDK.

[java] view plaincopy

java version “1.7.0_09”

Java(TM) SE Runtime Environment (build 1.7.0_09-b05)

Java HotSpot(TM) Client VM (build 23.5-b02, mixed mode)



Related Posts

The basic content of the component of the small program development icon, text

Drag -Drag progress bar display progress

Small program login to get user avatars and nicknames

[Inject] -ntmapViewOfsection

MAC Get the system version and model

Random Posts

Adobe Reader join the bookmark JavaScripts


Java Collections Class Overview and Use

Enhanced for loop

docker installation and fast entry (Mac) BUPT