![]() The Oracle JDK is the official JDK however, it is no longer provided by Oracle as a default installation for Ubuntu. If you instead need the Java Development Kit (JDK), execute the following command: sudo apt-get install openjdk-7-jdk This will install the Java Runtime Environment (JRE). To install OpenJDK 7, execute the following command: sudo apt-get install openjdk-7-jre That is everything that is needed to install Java. ![]() If you instead need the Java Development Kit (JDK), which is usually needed to compile Java applications (for example Apache Ant, Apache Maven, Eclipse and IntelliJ IDEA execute the following command: sudo apt-get install default-jdk If it returns "The program java can be found in the following packages", Java hasn't been installed yet, so execute the following command: sudo apt-get install default-jre Then, check if Java is not already installed: java -version First, update the package index: sudo apt-get update Following is the detailed process which covers almost all possible failures. I think you should consider Java installation procedure carefully. Repeat the above for: sudo update-alternatives -config javac Press enter to keep the current choice, or type selection number: 3 update-alternatives: using /usr/lib/jvm/jdk1.7.0_75/bin/java to provide /usr/bin/java (java) in manual mode * 0 /usr/lib/jvm/java-6-oracle1/bin/java 1047 auto modeĢ /usr/lib/jvm/java-6-oracle1/bin/java 1047 manual modeģ /usr/lib/jvm/jdk1.7.0_75/bin/java 1 manual mode There are 3 choices for the alternative java (providing /usr/bin/java). Now try: $ sudo update-alternatives -config java ![]() Sudo update-alternatives -set javaws /home/xxxxx/sipTest/jdk1.8.0_201/bin/javaws Sudo update-alternatives -set javac /home/xxxx/java/sipTest/jdk1.8.0_201/bin/javac sudo update-alternatives -set java /home/xxxx/sipTest/jdk1.8.0_201/bin/java Tell Ubuntu that our installation i.e., jdk1.8.0_05 must be the default Java. Sudo update-alternatives -install /usr/bin/javaws javaws /home/xxxx/java/jdk1.8.0_201/bin/javaws 20000 Sudo update-alternatives -install /usr/bin/javac javac /home/xxxx/java/jdk1.8.0_201/bin/javac 20000 sudo update-alternatives -install /usr/bin/java java /home/xxxx/java/jdk1.8.0_201/bin/java 20000 Let Ubuntu know where our JDK/JRE is located. Set path JAVA_HOME=path of your jdk folder(open jdk folder then right click on any folder, go to properties then copy the path using select all) like: /home/java(Folder name created by user in home directory). Note: According to comments this text was copied from a GIST without attribution.ĭownload java jdk-linux-圆4.tar.gz file from.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |