Use the update-alternatives command to inlcude both, java and javac as part of the system's Java environment.Please replace the below path to java binaries where appropriate to reflect your downloaded java version: # update-alternatives -install /usr/bin/java java /opt/java-jdk/jdk1.8.0_121/bin/java 1 Update-alternatives: error: no alternatives for java For example: $ curl -LOb "oraclelicense=a" Īt this stage, we should have an appropriate Java JDK tarball within our current working directory: $ lsĬreate a target Java JDK installation directory: # mkdir /opt/java-jdkĮxtract the previously downloaded Java JDK tarball: # tar -C /opt/java-jdk -zxf jdk-8u121-linux-圆4.tar.gzĬurrently, the system does not recognise our Java JDK installation: $ update-alternatives -list java To initiate the download of the desired Java file, copy its URL and start the download using the curl command while accepting the requested Jave license. The above command outputs a bunch of URLs for your selection. In case that you are attempting to install Java JDK remotely and have absolutely no access to Graphical User Interface and web browser use the following curl method to download Java JDK using a command line.įirst, obtain a correct download URL by using the curl command: $ curl -s | grep "otn-pub" | cut -d \" -f12 The last codeblock has some parts that you'll need to edit if you are not installing my same version. The first two codes help you install it if you had no GUI. In case somebody finds this thread because they are uninstalling Java so that they can install an Old Version, I have included a walk-through I found. So the above suggests that there is no java found of any version. So after reading the above ideas I went with: sudo apt-get remove openjdk*īash: /usr/bin/java: No such file or directory I came across this because I am working through an instructional book for android programming which wants to use a specific Java SE and JRE (8u121) and requests that all other java packages be removed before continuing with the installation. I also removed OpenJDK, which seemed to set it to "deinstall": # dpkg -get-selections | less | grep openjdk Nothing changes, the java-common package even still appears in the dpkg search. I proceed to remove java-common, however when it finishes java is still installed and java -version still shows the same thing. There doesn't seem to be an easy way to search for packages in apt so I'm using dpkg to search for java-related packages: # dpkg -get-selections | less | grep java OpenJDK 64-Bit Server VM (build 14.0-b16, mixed mode)
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |