Installing JDK at Linux.
- Step 1 : Download the binary.
- Step 2 : Extract the binary
- Step 3 : Defining which java
- Step 4 : Exporting the environment varaibles
Default java that comes with most distros are openjdk. Oracle JDK is indeed needed for development or deployment, so here is a brief steps to install JDK
Step 1 : Download the binary.
Head to the Oracle JDK download page for the latest JDK and choose the flavor that suite to your distros and architecture(32 bit or 64-bit) to download. Remember to Accept
the license agreement before downloading.
If you need any previous specific version of JDK head to the archive room.
If your distros fall under rpm category(check here), then you need to download jdk-<version>-linux-<i586/x64>-rpm.bin
. Otherwise just download jdk-<version>-linux-<i586/x64>-bin
.
Step 2 : Extract the binary
Depending on the binary that was downloaded, executing/installing the jdk would differ. Here are some ways to handle them.
jdk-<version>-linux-<i586/x64>-rpm.bin
Change the permission and execute it.
After the process completes jdk would be installed under /user/java/jdk<version>
and all the rpm packed would be extracted under the current directory. You can either delete those or save them for future use.
jdk-<version>-linux-<i586/x64>-bin
Change the permission and execute it.
After the process completes, jdk would be installed under /user/java/<version>
.
Step 3 : Defining which java
In order to use installed java instead of the openjdk, execute these commands: