How to install the linux system how to install the java development environment

Install Java Development Environment (Eclipse) in Red Hat 9

 

Foreword: JDK is the development environment of Java, with it, Java programs can be developed. At the same time, JRE is a Java runtime environment, and with JRE , Java programs can be run. Eclipse is software developed in Java, so JRE support is required.

 

This article is aimed at Linux beginners. Because I just started to use RedHat9 under the GUI yesterday, so I am also a beginner. Of course, I encountered many problems when installing the Java development environment. However, with the help of the literature of many netizens, I finally completed the attempt to install the Java development environment under RedHat9. I hereby organize the installation method into a document and write it here. Hope to be of little help to you.
 
     OK, let's get down to business.

One: Download the necessary software

     1: Sun's JDK 1.5 (jdk-1_5_0_09-linux-i586.bin)

     is the development kit for Java programs. Without it, the programs you write cannot be compiled.
       Download address: http://java.sun.com/javase/downloads/index.jsp 2: Sun's JRE 1.5 (jre-1_5_0_09-linux-i586.bin)        This is the operating environment of Eclipse. Because Eclipse is software written in Java, it cannot run without Sun's JRE.        Download address: http://java.sun.com/javase/downloads/index.jsp 3: IBM's Eclipse 3.2        This is software for writing programs, an integrated development environment (multiple languages ​​can be written).        Download address: http://www.eclipse.org/downloads/download.php?file=/eclipse/downloads/drops/R-3.2.1-200609210945/eclipse-SDK-3.2.1-linux-gtk.tar. gz

   



   

    Note: The above three softwares are all downloaded for Linux. For the two softwares of Sun, you can download the self-extracting bin. Also, it is recommended to download all files to the home directory. For example: my username is coffeecat, then my home directory is ../home/coffeecat

Two: Install the software
    1: Install JDK 1.5 (file name: jdk-1_5_0_09-linux-i586.bin)
       1: Open the main menu (Red Hat) --> System Tools --> Terminal (just like the cmd window under Windows)
       2: Enter our file name to execute the "self-extracting" file.
          ../home/coffeecat/jdk-1_5_0_09-linux-i586.bin
       3: The installation agreement appears on the screen, press the space to see the next page, wait until a question appears, reply yes, and after agreeing to the agreement, the program will automatically decompress. After decompression, the program will be installed automatically. The installed directory is ../usr/java
       4: Configure environment variables "Note: The configuration environment variables must be root to complete"
          Open the ../etc/profile file and add the following content in it

             export JAVA_HOME=/usr/java/jdk1.5.0_09
             export PATH=$JAVA_HOME/bin:$PATH
             CLASSPATH=.:/usr/java/jdk1.5.0_09/lib/tools.jar:$CLASSPATH
             export CLASSPATH

          Among them, if the JDK directory is different from mine, please change it yourself.

       Note: The program cannot be opened by double-clicking in the graphical interface, it can only be executed in the terminal.
           If you downloaded an RPM file, you will get an RPM file after self-extracting, which you can double-click to execute in the GUI.
    2: The method of installing JRE 1.5 (file name: jrk-1_5_0_09-linux-i586.bin)
       is the same as JDK, so it is omitted here.

    3: Install eclipse
       1: The downloaded file is a compressed file, you can decompress it under the graphical interface. The method is the same as using WinRar under Windows, right-click and select Unzip here. Then, a new folder eclipse appeared, which is our eclipse software.
       2: There is an eclipse file in the folder, which is an executable file. You can double click to open it. If there is a need for a JRE runtime environment, please see below. If you start eclipse normally, congratulations, you have completed the installation of eclipse, and you can buy a lottery ticket, maybe you will win the lottery.


Three: Solve the problem that eclipse needs JRE

    First of all, it is recommended that you copy the eclipse folder to ../usr/local, because it seems to be a folder dedicated to storing software.
    Open a terminal and enter the command

         ../usr/local/eclipse/eclipse -vm /usr/java/jdk1.5.0_09/bin/java

    You can open eclipse.
   
    Finally, you need to configure the JRE of eclipse, otherwise you will have to use the shell command every time you enter eclipse in the future, and you don't want this :)
    Configuration method: Window --> Preferences --> Java --> Installed JREs, Here you can select the JRE you installed. Then save the settings, and later, you can double-click the Eclipse icon to enter the software.


End ^_^

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326489214&siteId=291194637