[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Where is $JAVA_HOME/lib ?



Arnaud Vandyck wrote:
On 5/8/07, jim <jim@amarooas.com.au> wrote:
[...]
The application starts from the browser or directly by:
$JAVA_HOME/bin/java au.gov.bafcsi.clapi.crypto.CsiManager

Can this work with java-gcj-compat?

I don't know ;-)

What would be the proper location for the files? I have:
[...]
/usr/lib/jvm/java-1.4.2-gcj-4.1-1.4.2.0/jre/lib/security

This one seems appropriate but I don't know the program. Maybe other
users/devs have advices or comments?

Note that you'll have to reinstall your files when you upgrade java-gcj-compat.


Arnaud, everyone,

from a Java developer's point of view the JRE must be left alone. Nobody must be allowed to place application specific files anywhere in the JRE folder, or in jre/lib/ext.

To provide a Java application with the jars it needs the class path mechanism must be used via the parameters for the "java" executable, -jar and -cp.

When using the -jar switch -cp is being ignored and the application's (main) jar file must contain a manifest which has Class-Path entries which tell java about the other required jars and their (usually relative) path (in relation to the current working directory):

java -jar myapplication.jar

When using the -cp switch all jars and folders required in the default class path for that app must be enlisted:

java -cp .:myapplication.jar:mysql-jdbc-driver.jar myapplication.MainClass

(Side notes: The CLASSPATH environment variable should not be used (use -jar or -cp instead on a case by case basis), it should not be set globally (one can argue to use CLASSPATH inside a shell session, but for clarity and to deprecate use of CLASSPATH the -cp parameter should be preferred) due to possible version conflicts (application A requiring jdbc driver X version 1, application B requiring jdbc driver X version 2, both in the class path, results are random).

For the same reason the jre/lib/ext (extension mechanism) should be not used, esp. since it assumes backwards compatibility of the respective extension which in reality is something the Java world/developer just does/do not ever think about.)



Information must be provided which folders and jar files must be included in the class path for each application, or if the -jar parameter must be used. When invoking the application the respective parameters must be assembled and used.

Additional parameters must be supported, such as -client, -server, and these parameters can vary (or not exist), esp. in the non-Java implementations, so they must be mapped respectively or running the application should possibly be denied if the non-Java implementation does not provide the respective functionality.



Bye bye



Reply to: