Jake Pumphrey wrote:
On Friday 12 December 2003 02:18, Gregory Baboolal wrote:
How to update path to include own jdk install dir?
As far as I recall, I just added the path to my .bashrc ie PATH=$PATH:/usr/java/j2sdk1.4.2/bin.
Jake
i thought there were 3 places. 1st JAVA_HOME=/usr/java/j2sdk1.4.2 then PATH=$JAVA_HOME:$PATH then LD_PATH=$JAVA_HOME/bin:$PATH or something like that. Not sure. Soyoung
Quoting SUSE here: "The SuSE Linux distribution contains several versions of development kits for developing and running java applications and several versions of runtime environments only for running java applications. To be able to run java applications which need different versions of runtime environment or development kit, you may install several versions at the same time. One of these development kits or runtime environments is always the default while the other versions can be used to develope or run particular applications. Note: In the next text JDK stands for java development kit and JRE for java runtime environment. The java configuration files: ----------------------------- All the JDKs and JREs distributed within the SuSE linux have its own configuration file in directory /etc/java. This configuration files are used by various scripts (see below) which can help you to operate with various JREs and JDKs. You can see more information about java configuration files in file /etc/java/README. Attention: Script setJava and the information in the configuration files are used also in java applications distributed within SuSE linux. Please be patient when you install your own JDK or JRE and you want to add a new configuration file in /etc/java. Java related environment variables: ----------------------------------- PATH: - the search path for commands - it can contain also the path where the java compiler and the interpreter are located JAVA_BINDIR: - the path to the directory with java executables - this value is usually used in the PATH environment variable JAVA_ROOT: - the path to java root directory - it is exactly the same for JDK and JRE of the same version and vendor JAVA_HOME: - the path to the direcory which contains all files for a given JDK or JRE - some applications use this value to find java executables in $JAVA_HOME/bin - the value is usually different for JDK and JRE of the same version and vendor JRE_HOME: - the path to the direcory which contains all files for given JRE - some applications use this value to find java executables in $JRE_HOME/bin - the value is the same for JDK and JRE of the same version and vendor (JRE's form a subset of JDK's) JDK_HOME: - the path to the direcory which contains all files for given JDK - some applications use this value to find java executables in $JDK_HOME/bin - it is defined only for JDK's SDK_HOME: - the path to the direcory which contains all files for given JDK - some applications search for java executables in $SDK_HOME/bin - it is defined only for JDK's with version 1.2 or higher Note: Various versions of JDK and JRE have different directory tree structures. Compactibility links: --------------------- SuSEconfig maintains some links which can also help you to find valid JDK or JRE: /usr/lib/java - default java (see below) /usr/lib/java1 - points to any JDK or JRE with version 1.1.x /usr/lib/java2 - points to any JDK or JRE with version 1.2 or higher /usr/lib/SunJava1 - points to any JDK or JRE from Sun Microsystems with version 1.1.x /usr/lib/SunJava2 - points to any JDK or JRE from Sun Microsystems with version 1.2 or higher /usr/lib/IBMJava2 - points to any JDK or JRE from IBM with version 1.2 or higher /usr/lib/BlackdownJava2 - points to any JDK or JRE from Blackdown with version 1.2 or higher Not all the links have to exist at a time. SuSEconfig uses next rules: - create the link when related JDK or JRE exists - do not change the link which point to a valid JDK or JRE - fix the link if it points a nonexisting target or it points to a directory with no JDK nor JRE and related JDK or JRE exists - remove the link if it points to a nonexisting target or it points to a directory with no JDK nor JRE and related JDK nor JRE does not exist At your own risk, you may disable this SuSEconfig behaviour by setting the variable CREATE_JAVALINK="no" in /etc/sysconfig/java. Take into account that also java applications dististributed within SuSE linux use links maintained by SuSEconfig. The default java: ----------------- The default java is a JDK or JRE which will be used unless another JDK nor JRE has been specified. It is defined by symbolic link /usr/lib/java which can easily be changed by using the script setDefaultJava. Examples: 1. Print help for script setDefaultJava: setDefaultJava --help 2. Set any java from Sun Microsystems with version 1.3.x or higher as your default java: setDefaultJava --vendor Sun --version 1.3 Attention: No application using the default java should be running during this change. Only administrator (root) has permissions to change link /usr/lib/java. See files /etc/java/*.conf for information about available JRE's and JDK's. By default, each shell has set several environment variables (see above) which point to the default java (using path /usr/lib/java). When you change the default java then these variables will no longer be valid in all running shells . When you start new shell, they will be set correctly again. By default SuSEconfig ensures the validity of the link /usr/lib/java. The link will be corrected if it points to an invalid directory. At your own risk you may disable this SuSEconfig behaviour by setting the variable CREATE_JAVALINK="no" in /etc/sysconfig/java. Take into account that also java applications dististributed within SuSE linux use links maintained by SuSEconfig. Java for your application: -------------------------- Most java applications use the JRE found according to the path in the environment variable PATH. Sometimes also another environment variables are used (JAVA_HOME, JRE_HOME, ..., see above). The default values of these environment variables point to the default java (/usr/lib/java). If you want to develop or run your application with another version of JDK or JRE you can use the script setJava, which will change the enviroment variables to the requested java package: Examples: 1. Print help for the script setJava: setJava --help 2. Set environment varibales for java from Sun Microsystems with version 1.3.x or higher: source setJava --vendor Sun --version 1.3 !!! Important !!! Do not forget to run this script with "source" shell command because the result of the script must be sourced to change the settings in the current shell. Moreover, the application must also be run from this shell. See files /etc/java/*.conf for informations about available JRE's and JDK's. ---------------------------------------- You've hopefully read this already (Gregory), but what the heck. You're right Soyoung, I was being a bit simplistic. To be honest when i installed my j2sdk1.4.2 I was/(am) new to Linux and was just keen to get Eclipse fired up and working. Next time I will take notes and be better able to offer best advice. I don't recall doing anything more difficult than creating a j2sdk1.4.2.conf in /etc/java/ and adding the j2sdk to my path in .bashrc and pointing Eclipse that way when I ran it. Perhaps this is selective memory! All Best Jake
participants (3)
-
Gregory Baboolal
-
Jake Pumphrey
-
Soyoung Park