Summary: | Adding Java aliases for java-config | ||
---|---|---|---|
Product: | [OLD] Docs-user | Reporter: | tom |
Component: | Gentoo Java Guide | Assignee: | Sven Vermeulen (RETIRED) <swift> |
Status: | RESOLVED WONTFIX | ||
Severity: | enhancement | CC: | docs-team, karltk |
Priority: | High | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
URL: | http://www.gentoo.org/doc/en/java.xml | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- |
Description
tom
2003-07-22 06:04:39 UTC
Actually at my system "java-config --java" and "which java" return the same. I see no reason for the users to create an alias for java if it works. Hi I'm assuming this is because you've got the correct java directory in your PATH, which isn't there by default becasue it goes in /opt/. Thinking about it a better way of doing it without using aliases is to add the correct java dir to your PATH. This way all the java binaries, including appletviewer etc., will point to the correct ones. I've added this to my ~/.bash_profile: PATH=/dirs/in/path JAVAPATH=`java-config --jdk-home`/bin PATH=${PATH}:${JAVAPATH} export PATH Without a java dir in your path `which java` gives the error: which: no java in (/dirs/in/path) This ensures that you're always using the correct java, appletviewer, etc. as long as you remember to `. ~/.bash_profile` after you change the jdk with java-config. The java binaries are placed inside their /opt directories, and the PATH variable is extended with that directory (check /etc/env.d/20java and /etc/env.d/30java-finalclasspath). Installing java automatically sets those stuff. If some java ebuild doesn't do that, then that's an error of the ebuild. |