Linux jdk-linux-i586.rpm.bin Installation

Source: Internet
Author: User


Linux installation jdk-linux-i586.rpm.bin installation jdk-linux-i586.rpm.bin chmod u + x j2sdk-1_4_1_02-linux-i586-rpm.bin. /j2sdk-1_4_1_02-linux-i586-rpm.bin Note: If you directly execute the unzip command to extract it is also possible, in short to get an rpm package. www.2cto.com 3. the program will automatically generate a j2sdk-1_4_2_06-linux-i586.rpm file, which is the main package, which will be installed below; [root @ LinuxServer rpm] # rpm-ivh j2sdk-1_4_2_06-linux-i586.rpm Preparing... ######################################## ### [100%] 1: j2sdk ##################### ##################### [100%] 4. to set environment variables, you usually like to use the export command to directly set [root @ LinuxServer rpm] # export JAVA_HOME =/usr/java/j2sdk1.4.2 _ 06 [root @ LinuxServer rpm] # export CLASSPATH =.: $ JAVA_HOME/lib/dt. jar: $ JAVA_HOME/lib/tools. jar [root @ LinuxServer rpm] # export PATH = $ PATH: $ JAVA_HOME/bin. Of course, this setting of environment variables takes effect only for the current shell. If you log on from another shell, you cannot use the variable you just set. So the best way is to modify the. bashr c file. [Root @ LinuxServer rpm] # vi. bashrc set JAVA_HOME =/usr/java/j2sdk1.4.2 _ 06 export JAVA_HOME set PATH = $ PATH: $ JAVA_HOME/bin export PATH set CLASSPATH =.: $ JAVA_HOME/lib/dt. jar: $ JAVA_HOME/lib/tools. jar export CLASSPATH www.2cto.com can also be implemented by changing/etc/profile. However, this setting is not recommended because it will take effect for your shell, this will affect system security.
Add: export JAVA_HOME =/usr/java/j2sdk1.4.2 _ 06 export CLASSPATH =.: $ JAVA_HOME/lib/dt. jar: $ JAVA_HOME/lib/tools. jar export PATH = $ PATH: $ JAVA_HOME/bin to verify whether the variable settings take effect (#### Note: log out before verification, and then log on again ); [root @ LinuxServer rpm] # echo $ JAVA_HOME/usr/java/j2sdk1.4.2 _ 06/[root @ LinuxServer rpm] # echo $ CLASSPATH/usr/java/j2sdk1.4.2 _ 06/lib/ dt. jar:/usr/java/j2sdk1.4.2 _ 06/lib/tools. jar [root @ LinuxServer rpm] # Echo $ PATH/usr/java/j2sdk1.4.2 _ 06/bin/:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbi n: /usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin: /root/bin [root @ LinuxServer rpm] # JAVA-version JAVA version "1.4.2 _ 06" JAVA (TM) 2 Runtime Environment, Standard Edition (build 1.4.2 _ 06-b03) JAVA HotSpot (TM) Client VM (build 1.4.2 _ 06-b03, mixed mode) 5. set the environment to OK to see if JDK works normally. Let's write a test file. java [Root @ LinuxServer rpm] # vi test. java class test {public static void main (String [] args) {System. out. println ("Hello World! ") ;}} Www.2cto.com save and exit. Compile and execute the command below. [root @ LinuxServer text] # javac test. java [root @ LinuxServer text] # JAVA test Hello World! OK. The operation is normal. 6. To allow a user to run java commands, modify the bash initialization file. For example, to grant longware the permission to run java commands, [root @ LinuxServer root] # vi/home/longware /. bashrc set JAVA_HOME =/usr/java/j2sdk1.4.2 _ 06 export JAVA_HOME set PATH = $ PATH: $ JAVA_HOME/bin export PATH set CLASSPATH =.: $ JAVA_HOME/lib/dt. jar: $ JAVA_HOME/lib/tools. jar export CLASSPATH 7. so far, JDK installation on Linux is complete. Install eclipse-sdk-3.0-linux-gtk.zip to the http://www.eclipse.org to unzip eclipse-sdk-3.0-linux-gtk.zip to/opt 8. Write a script to start eclipse #! /Bin/bash # Run eclipse 3 # www.2cto.com export JAVA_HOME =/usr/java/j2sdk1.4.2 _ 06 export CLASSPATH =/usr/java/j2sdk1.4.2 _ 06/lib/opt/eclipse/ eclipse-vm/usr/java/j2sdk1.4.2 _ 06/bin/java-data/home/chenzhe/wo rkspace & #-vm parameters are used to specify which jvm is used to execute Eclipse, # The-date parameter is used to specify the Eclipse data directory. Save the script to/usr/local/bin in the workspace directory in the root directory of the user (/home/chenzhe/), called eclipse, assign 755 permissions to eclipse 9. Create a starter on the desktop, select an icon, set the path to/opt/eclipse,/opt/eclipse/icon. xpm is the eclipse self-built icon. 10. Double-click the icon or enter eclipse on the terminal! # JRVOTE # author mutourenoo

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.