4 ms·
Why is this easier than making ~/lib/java-latest softlinked to ~/lib/jdk1.6.0_30 then just re-linking to the one you want to use while having export JAVA_HOME=~
by dekz 15y ago
Why is this easier than making ~/lib/java-latest softlinked to ~/lib/jdk1.6.0_30 then just re-linking to the one you want to use while having export JAVA_HOME=~/lib/java-latest in ~/*rc .
At least this way it isn't ubuntu specific and you don't have to know about update-alternatives (first time for me hearing of that).
- SkyMarshal 15y agoYou could do that too, only problem I can think of is if you also want to install OpenJDK from the Ubuntu repos. Presuming that, in addition to what you said, you also add your new $JAVA_HOME/bin to your $PATH, then you'll have a namespace collision in your PATH between $JAVA_HOME/bin/java and /usr/bin/java (OpenJDK linked via /etc/alternatives/java via /usr/lib/jvm/openjdk/bin/java, which is the default install setup for openjdk, on 11.10 at least). If you're installing OpenJDK manually too, instead of via repo, or not at all, then keeping all your jdk's in ~/lib might be a better option overall.