This bug was automatically imported into Bugtraq+ from Bugzilla.
See http://bugzilla.gnome.org/show_bug.cgi?id=93135
The Java 1.4 runtime environment requires some additional files
in order that the Gnome Java bridge operates. An
'accessibility.properties' and 'gnome-java-bridge.jar' need to be
copied by the end user into the jre/lib and jre/lib/ext directories
respectively.
This manual copy should be addressed.
------- Additional Comments From xxxxx@xxxxx.com 2002-10-08 09:59 -------
the gnome-java-access.jar file shouldn't be copied into the JRE
directory. We are installing GNOME-related jarfiles in
$prefix/share/jar/; the user environment shoudl include an appropriate
CLASSPATH link.
The accessibility.properties issues is a real one though.
------- Additional Comments From xxxxx@xxxxx.com 2002-10-08 10:53 -------
I don't agree, I've never been able to get my JDK working without
the jarfile in lib/ext.
I've tried it with the jar in $CLASSPATH and also with the command-line
argument to java (-classpath). Neither work. As soon as the properties
file is loaded it attempts to create the JavaBridge class and fails:
java -classpath /opt/gnome-2.0/share/jar/gnome-java-bridge.jar -jar
/usr/java/j2sdk1.4.0-accessible/demo/jfc/Stylepad/Stylepad.jar
Exception in thread "main" java.awt.AWTError: Assistive Technology not
found: org.GNOME.Accessibility.JavaBridge
at java.awt.Toolkit.loadAssistiveTechnologies(Toolkit.java:654)
at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:738)
at java.awt.Window.getToolkit(Window.java:652)
at java.awt.Window.init(Window.java:223)
at java.awt.Window.<init>(Window.java:252)
at java.awt.Frame.<init>(Frame.java:398)
at java.awt.Frame.<init>(Frame.java:363)
at javax.swing.JFrame.<init>(JFrame.java:154)
at Stylepad.main(Stylepad.java:48)
------- Additional Comments From xxxxx@xxxxx.com 2002-10-15 10:24 -------
sounds like a JRE bug then, since I (used to) use the $CLASSPATH
environment variable without problems. I haven't tried it lately, but
didn't install to the JRE's directory.
We *really* should not be putting the jarfile in the system JRE ext
directory, that is probably not going to be allowed by ARC and will
mean accessibility only works for some Java apps on a given system
(since many systems have multiple VMs).
------- Additional Comments From xxxxx@xxxxx.com 2002-10-16 07:14 -------
Since Java 2 came out it there is a "bootclasspath" AND a "classpath".
The bootclasspath is used for the loading of the system libraries
such as rt.jar and the AWT. On loading of the AWT a check is done for
the existance of the accessibility.properties file, if it's present
the properties are loaded from it and the name of the class to
instanciate extracted. This class is then created using the
"primordial" class loader (ie. the non-Java Implemntation of a class
loader in the JVM itself) since it was the classloader that created
the AWT classes... Because of when this is done the fact that the
jar file is on the classpath is ignored since it is only for
"User" libraries, as opposed to "System" libraries.
Installing in the lib/ext (or Extensions) directory is a perfectly
valid thing to do, which is also well documented in the Java
documentation. This is the recommended way to install such a
library.
There is also the fact that if the bridge is not loaded but the
accessibility.properties files says that is should be instanciated
the java application will never be started exiting immediately with
an exception. If we are going to install a properties file that
has this kind of effect we MUST also ensure that the jar file
containing the object to be instanciated is present otherwise
the java installation will be severely broken, we cannot depend
on a user setting an environment variable.
------- Additional Comments From xxxxx@xxxxx.com 2002-10-16 11:29 -------
After much looking and debugging, I've tracked down the problem...
It does appear to be a problem with the way things are done in Java.
Firstly, I'll explain what's happening:
1) Ignore my previous comments about the bootclasspath... But I still
want to maintain my insistance of installation into lib/ext
(I'll discuss later).
2) Specifying the command :
java -cp .../gnome-access-bridge.jar:.../Stylepad.jar Stylepad
DOES work in that it will load the JABG.
3) What DOES NOT work is the command:
java -cp .../gnome-access-bridge.jar -jar .../Stylepad.jar
In this case, the java launcher program on seeing the -jar
option promply replaces the classpath with the jar... This is
a documented behaviour, since the jar file is expected to be
TOTALLY stand-alone! (Which I think is unreasonable).
4) This requires any native application that wishes to use JNI
to start up a Java VM with Accessibility enabled to have to
include <GNOME_HOME>/share/jar/gnome-access-bridge.jar in
it's classpath since the CLASSPATH environment variable means
nothing to a VM started this way.
The problem with relying on the JAR file in <GNOME_HOME>/share/jar
has it's own problems in relation to a VM that specifies the
JavaBridge class in it's accessibility.properties file, namely:
1) A Java VM that gets executed without CLASSPATH set is basically
unusable for UI based applications.
2) On Solaris 8 (and Linux has this too IIRC) there is the
possibility of executing a jar file simply by name, if the
executable permissions are set (ie. chmod +x)... eg.
./Stylepad.jar
In this case the classpath is also ignored...
I still am of the opinion that the JABG is a Java Extension, as
defined by the term:
"An optional package is a group of packages housed in one or more JAR
files that implement an API that extends the Java platform. Optional
package classes extend the platform in the sense that the virtual
machine can find and load them without their being on the class path,
much as if they were classes in the platform's core API."
In the case of the JABG we are extending java to enable it to provide
accessibility in the GNOME environment.
More can be seen at:
http://java.sun.com/j2se/1.4/docs/guide/extensions/index.html
======================================================================
This bug needs to be addressed for Cinnabar builds also.
xxxxx@xxxxx.com 2004-05-11
Note: we've documented for years that Windows users must put the accessbridge.jar file into their jre/lib/ext directory (and accessibility.properties into jre/lib). We ship an installer that does this explicitly with the Windows Access Bridge download.
On GNOME it may make more sense to make these symlinks to /usr/share/gnome/jar/... instead. Using CLASSPATH variants seems to always have some sort of failure possibility depending upon how the JVM is invoked (e.g. InstallAnywhere-based apps). Copy the file, or make a symlink!
xxxxx@xxxxx.com 2004-06-15
xxxxx@xxxxx.com 10/6/04 15:36 GMT
Work Around
See Description
======================================================================
xxxxx@xxxxx.com 10/6/04 15:36 GMT
To be explicit, as root the user must execute the following two commands:
ln -s /usr/share/jar/accessibility.properties \
/usr/java/j2redefault/lib/accessibility.properties
ln -s /usr/share/jar/gnome-java-bridge.jar \
/usr/java/j2redefault/lib/ext/gnome-java-bridge.jar
xxxxx@xxxxx.com 2005-2-10 18:33:50 GMT