Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

Configure the java environment using yum in linux

Shulou Source: shulou.com Published: 2022-06-03 05:33:46 11月24日 Update

1. Find a list of java related items

[root@localhost ~] $yum-y list java*

two。 Installation related

Yum install java-1.6.0-openjdk*

Be sure to mount / dev/cdrom to / mnt/cdrom (here I have configured the yum source of my disk here in / etc/yum.repos.d/cd.repo, so I have to mount the CD, of course)

Click on the link here, and note that the image file must be used correctly! I used it incorrectly so that I couldn't install yum all the time.

After mounting, there will be the following files under / mnt/cdrom!

3. Confirm that the installation is successful

[root@localhost ~] $java-version

4. Modify the / etc/profile file, note that I am debugging and playing by myself, once modified, all users here have the permission to compile java!

5. Load this configuration file using source / etc/profile!

6. Write a program at will

Javac Test.java

Java Test

The output indicates that the environment configuration is complete!

Tags: Files configuration environment success CD permissions users disks programs trial play mirroring related compilation output Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MariaDB Shulou Tech Info vpn Microsoft Docker