openSUSE Installation ORACLE-JDK

Source: Internet
Author: User

Prerequisites: For OPENJDK and JDK differences and links, see this article anyway, remember that a word jdk is more complete and stable than openjdk.
I am using openSUSE 13.1, the default is OPENJDK after installation, the following is the process of replacing OPENJDK with JDK1.7.
There is little technical stuff, just looking for no opensuse How to modify environment variables, openSUSE How to install RPM files, how to refresh environment variables without restarting.
The first step: download jdk1.7 (after all, 1.8 just out, now the mainstream or 1.7) official website
Step two : console input java-version View the current JDK version, you will find the openjdk1.x, open YaST Software management, search OPENJDK and then uninstall it.
Step Three: Install the JDK
The first: There are two ways to install, the first openSUSE right-click File (jdk-7u55-linux-x64.rpm), open mode Select "Install/Remove Software", and then install through the powerful YaST
The second type: Install the rpm command Zypper install + xxx.rpm with openSUSE
Fourth Step: Add environment variables (the same principle as Windows)
because the default installation path for the JDK is under/user/java, note the path problem in the environment variable .
The configuration file for the environment variables for Linux is/etc/profile to add the following content to the bottom of profile. Note that the JDK version is changed to your own version.

Export Java_home=/usr/java/jdk1.7.0_55/export jre_home=/usr/java/jdk1.7.0_55/jreexport CLASSPATH= $CLASSPATH: $JAVA _home/lib: $JAVA _home/jre/libexport path= $JAVA _home/bin: $JAVA _home/jre/bin: $PATH

Fifth Step: Refresh the configuration file
Source Profile
Sixth Step: then enter java-version in the console, this time will show the following content.

Don't tangle with my fonts, I just installed the openSUSE, plan to open Linux later, have not had time to import fonts.
That's it. You can use eclipse to develop your Java application.
Note: you want to simply click on this method of my configuration. If you want to "challenge" yourself, do not uninstall OpenJDK, install JDK directly, let JDK and openjdk coexist, this time need to use update-alternatives--config Java configuration priority.

Related Article

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.