AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
Install openjdk 11 on linux12/14/2022
home/rick/Android/Sdk/sources/android-28/org/openjdk/testlib/java/util/stream/DoubleStreamTestDataProvider.java home/rick/Android/Sdk/sources/android-28/org/openjdk/testlib/java/util/stream/CollectorOps.java home/rick/Android/Sdk/sources/android-28/org/openjdk/testlib/java/util/stream home/rick/Android/Sdk/sources/android-28/org/openjdk/testlib/java/util home/rick/Android/Sdk/sources/android-28/org/openjdk/testlib/java home/rick/Android/Sdk/sources/android-28/org/openjdk/testlib home/rick/Android/Sdk/sources/android-28/org/openjdk It is extremely fast: $ locate openjdk | head -n10 bashrc using a command that looks like this : export JAVA_HOME=`dirname $(dirname $(readlink -f $(which java)))`Īn alternative to whereis and find command is the locate command. To help you to retrieve the java home path you can use which java | xargs realpath which provides a path like /usr/lib/jvm/java-11-openjdk-amd64/bin/java (or you can use ls -l several times on the path provided by which) from which you need to remove the latest part /bin/java.īe careful with the fact that if you need several java runtimes on your system, then the PATH resolution and the JAVA_HOME must match to the same version.Īt your convenience, you can unzip any specific version in any folder like /my/custom/install/jdk15/Īnd override the system paths : export JAVA_HOME=/my/custom/install/jdk15 Then you can set it to the home dir of your java install, for example JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64 also keep in mind that some java applications may need to set the JAVA_HOME environment variable.OpenJDK 64-Bit Server VM (build 11.0.11+9-Ubuntu-0ubuntu2.20.04, mixed mode, sharing) OpenJDK Runtime Environment (build 11.0.11+9-Ubuntu-0ubuntu2.20.04) Is it a valid binary then ? try to display its version using the command java -version and it should display something like Now you can check if it can be executed properly :ĭoes its location belong to your PATH variable ? try the command which java and it should return something like /usr/bin/java Since you have previously checked with whereis whether your binary is installed, #Install openjdk 11 on linux manual#Whereis (1) - locate the binary, source, and manual page files for a command #Install openjdk 11 on linux full#Which (1) - shows the full path of (shell) commands Using which in this context! Is better then whereis!įor the difference between which and whereis! Let's use whatis $ whatis which You can see and can find your home directory! Readlink symbolicLink => Will give what it resolve toįrom the help doc -f, -canonicalize canonicalize by following every symlink inĮvery component of the given name recursively Readlink - print resolved symbolic links or canonical file names We can do that through read link Readlink Symlink => Symlink => Actual folder or file If you want to use whereis! One need to resolve the symlinks too! And here recursively! usr/lib/jvm/java-10-openjdk-amd64/bin/java is the actual java binary! And /usr/lib/jvm/java-10-openjdk-amd64 is the java home. usr/bin/java =symlink to=> /etc/alternatives/java =symlink to=> /usr/lib/jvm/java-10-openjdk-amd64/bin/java Which java => give Command path => return a symlink to a symlink It'd look something like:įirst whereis! Just like which doesn't resolve symlinks! You can run ls /usr/lib/jvm/java-11-openjdk-amd64 and it will show the jdk folder content. usr/lib/jvm/java-11-openjdk-amd64/bin/java It returns the path, in my case it returns: Then, in order to locate the jdk folder, run the command below: readlink -f $(which java) I also try giving /usr/share/java to the ghidra installation, but it complains that this is not a valid jdk home directory because it is missing a bin folder.įirst, make sure the installation was done correctly by running java -version, you should see something like: Here is a bunch of jar files? Usually the jdk has a bin folder and so on? So I cd to the first directory, ans look: /usr/share/java$ lsĬommons-logging-1.2.jar java-atk-wrapper.jar pdfbox-1.8.16.jarĬommons-logging-adapters-1.2.jar java_defaults.mk pdfbox.jarĬommons-logging-adapters.jar java_uno.jar ridl-6.4.7.jarĬommons-logging-api-1.2.jar juh-6.4.7.jar ridl.jarĬommons-logging-api.jar juh.jar unoloader-6.4.7.jarĬommons-logging.jar jurt-6.4.7.jar unoloader.jar Java: /usr/bin/java /usr/share/java /usr/share/man/man1/java.1.gz If I now run whereis java: /usr/share/java$ whereis java #Install openjdk 11 on linux install#So, I think cool, and run: sudo apt-get install openjdk-11-jdk JDK 11+ (64-bit) could not be found and must be manually chosen! I'm currently trying to install ghidra on my Ubuntu 20.04 machine.
0 Comments
Read More
Leave a Reply. |