This will work to add the repository to your sources list and import the associated key. You can decide which versions you would like to install, and can choose to install one or several. Oracle JDK 8 is the latest stable version of Java at time of writing. You can install it using the following command:. Once the installation is complete, you can verify your Java version:. At this point, you have Oracle JDK 8 installed, but you may want to also install one or more of the versions below.
Oracle JDK 9 is currently available for early access through its developer preview. The general release is scheduled for summer There is more information about Java 9 on the official JDK 9 website. While it may be worth investigating Oracle JDK 9, there may still be security issues and bugs, so you should opt for Oracle JDK 8 as your default version. There can be multiple Java installations on one server. You can configure which version is the default for use in the command line by using update-alternatives , which manages which symbolic links are used for different commands.
The output will look something like the following. In this case, all Java versions mentioned above were installed. If we press the enter key in this case, Java 9 will be kept as the default. We can, for example, press 3 for Java 8 and receive the following output:. Now Java 8 would be the default. Choose the default Java version that works best for your projects.
The update-alternatives command can also be used for other Java commands, such as the compiler javac , the documentation generator javadoc , the JAR signing tool jarsigner , and more. You can use the following command, filling in the command you want to customize. To set this environment variable, we will first need to find out where Java is installed. You can do this by executing the same command as in the previous section:.
In this file, add the following line, making sure to replace the highlighted path with your own copied path. You can now test whether the environment variable has been set by executing the following command:. You have now installed Java and know how to manage different versions of it.
Where would you like to share this to? Of course, Java is also the name of a popular island of Indonesia. Download Java Download a suitable version of Java that you like. If you plan to create Java apps yourself you need the JDK. Proceed to the website of Sun, IBM or Blackdown to download a Java version that you want and that is available for your hardware architecture. Sun Java 5. If you are using a bit x86 version of Debian on an AMD64 processor using system, download the Java for the bit x86 version.
Also worth noting, the Sun Java 1. Install java-package in Debian Now install the package java-package which provides the make-jpkg utility for creating the. Execute apt-get install java-package Create the Java deb package with make-jpkg Create the deb package of the Sun or Blackdown Java self-extracting.
In this example the Java 1. Note to execute this as a normal user by using fakeroot which was installed as a dependency of java-package as make-jpkg cannot be executed as root. As long as the deb package gets created the warnings are nothing to worry about. The deb package is created in the same directory as the command was executed from.
To see what exactly the file name your just created.
0コメント