Walter Landry wrote:
> [...]
> All of the examples given above are good, but libgetenv-java is about
> as clear as you can get. It only depends on java2-runtime and libc,
> and it serves as a replacement for java.lang.System.getenv. It
> creates a hybrid implementation.
>
> If you want to argue that it is the other packages fault, go ahead.
> That would make the java2-runtime virtual package much less useful, in
> which case there should be a java2-runtime-free virtual package.
Obviously making sun-java5 not provide java2-runtime (or whatever
provides Debian Java Policy settles upon) defeats the purpose
of packaging Sun Java.
I appreciate your trying to address an entire class of problems, but
in the case of libgetenv-java it appears that the jar is malformed.
We're it formed correctly it would be in it's own namespace.
The README.Debian says:
libgetenv-java for Debian
-------------------------
To use libgetenv-java in an application, make sure your classpath includes
/usr/share/java/libgetenv-java.jar and LD_LIBRARY_PATH includes /usr/lib/jni
-- Mark Howard <[EMAIL PROTECTED]>, Fri, 27 Jun 2003 15:50:01 +0100
Inspection of the jar file in the aforementioned package
shows:
=== /usr/share/java/libgetenv-java.jar ===
0 Tue Oct 25 05:09:28 CDT 2005 META-INF/
48 Tue Oct 25 05:09:28 CDT 2005 META-INF/MANIFEST.MF
376 Tue Oct 25 05:09:28 CDT 2005 uk/co/tigress/System.class
[EMAIL PROTECTED] 148% jar xf /usr/share/java/libgetenv-java.jar
[EMAIL PROTECTED] 151% cd uk/co/tigress/
/tmp/uk/co/tigress
[EMAIL PROTECTED] 155% javap System
Compiled from "System.java"
public class System extends java.lang.Object{
public static native java.lang.String getenv(java.lang.String);
}
[EMAIL PROTECTED] 156%
So IN THIS CASE... it appears that the jar file is malformed
because I cannot even compile a Java program to use this alternative class
by using "import uk.co.tigress.System;" (see attached altenv.java).
This would appear to because the source file did not specify that
it was in the "package uk.co.tigress;".
[EMAIL PROTECTED] 212% javac -cp .:/usr/share/java/libgetenv-java.jar
altenv.java
altenv.java:3: cannot access uk.co.tigress.System
bad class file: /usr/share/java/libgetenv-java.jar(uk/co/tigress/System.class)
class file contains wrong class: System
Please remove or make sure it appears in the correct subdirectory of the
classpath.
import uk.co.tigress.System;
^
1 error
[EMAIL PROTECTED] 213%
So I can't even get this package to work, let alone provide an
example of how it would be a problem with the DLJ.
Please advise,
--Tom
// altenv.java
import uk.co.tigress.System;
public class altenv {
public static void main(String[] args) {
if (args.length != 0) {
System.out.println("usage: java sunenv");
} else {
try {
String env1 = "HOME";
String val1 = System.getenv(env1);
System.out.println("env " + env1 + " = " + val1);
String env2 = "PATH";
String val2 = System.getenv(env2);
System.out.println("env " + env2 + " = " + val2);
} catch (Exception e) {
System.out.println("unable to get environment variables");
System.out.println("Exception: " + e);
}
}
}
}