6/12/2023 0 Comments Update alternatives java![]() If I run update-alternatives with the -display option, I can see that there is a symbolic link at /bin/nc, and it points currently to /bin/nc. ![]() In a clean Kali install, nc is simply nc (actually nc.traditional, as I’ll show in a moment). This is managed by the alternatives system. If you’ve ever installed ncat, you may have noticed that running nc actually now runs ncat. You should configure the path for java '/bin' directory and a number for each version according to your system. ![]() 121 3 Add a comment 0 You may use the script below. For this specific purpose, the package java-common contains a tool called update-java-alternatives. So to go for OpenJDK 6 to 7, I used update-java-alternatives -l to get a list of Java alternatives and then used sudo update-java-alternatives -s java-1.7.0-openjdk-amd64 to the JDK. update-alternatives -set java (update-alternatives -list java grep java-11) Share Improve this answer Follow answered at 19:54 Oleksii K. update-alternatives is problematic in this case as it forces you to update all the elements depending on the JDK. There’s a more powerful version, ncat, that brings in additional functionality, like SSL support, IPv6 support, and proxy support. The trick is to use update-java-alternatives (from the java-common package). Nc is the Swiss Army knife of hacking at things. I’ll use update-altneratives to install the new Java version, and then to change what version java, javac, jar, etc utilize. update-alternatives creates, removes, maintains and displays information about the symbolic links comprising the Debian alternatives system. For example, I’m currently working on a challenge that requires using an older version of Java to interact with a file. But there are times when it is really useful to know how to interact with this yourself. When you run apt install x, it may do some of this behind the scenes for you. Most of the time, this is managed by the package management system. Using update-alternatives for switching between multiple versions of Java is a pain since each tool of a JRE or JDK is its own group of alternatives. update-alternatives is a symbolic link management system for linux (Im. Debian Linux (and its derivatives like Ubuntu and Kali) has a system called alternatives that’s designed to manage having different version of some software, or aliasing different commands to different versions within the system. update-java-alternatives is a program to update alternatives for jre/jdk installations.
0 Comments
Leave a Reply. |