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.