Hi:
First, I'm not a programer. I'm maintaining OmegaT and dependencies in Fedora, all java based.
Since first moment I'm experiencing problems with the CLASSPATH. When removing it from the MANIFEST I can't get the jvm to find the dependencies, no matter I set them by the CLASSPATH variable or the -cp option.
I'm supposing I'm doing (or not doing) something almost trivial. Anybody have any idea of what I'm doing wrong? Any document to read?
Of course I've readed the Fedora Java package guidelines but doesn't helped me.
Thanks in advance.
Ismael Olea wrote:
First, I'm not a programer. I'm maintaining OmegaT and dependencies in Fedora, all java based.
Since first moment I'm experiencing problems with the CLASSPATH. When removing it from the MANIFEST I can't get the jvm to find the dependencies, no matter I set them by the CLASSPATH variable or the -cp option.
I'm supposing I'm doing (or not doing) something almost trivial. Anybody have any idea of what I'm doing wrong? Any document to read?
Of course I've readed the Fedora Java package guidelines but doesn't helped me.
It's hard to say, because you haven't told us what you are doing,
Does OmegaT have a startup script? If so, do something like this:
LOCALCLASSPATH="$(/usr/bin/build-classpath jaxp_parser_impl xml-commons-apis)"
java -classpath "$LOCALCLASSPATH" ...
That's what the other Java startup scripts do. There are plenty of examples.
Andrew.
2008/11/26 Andrew Haley aph@redhat.com
It's hard to say, because you haven't told us what you are doing,
I know, but I prefered not to flood you with not relevant details.
Does OmegaT have a startup script? If so, do something like this:
of course.
LOCALCLASSPATH="$(/usr/bin/build-classpath jaxp_parser_impl xml-commons-apis)"
java -classpath "$LOCALCLASSPATH" ...
I tried several combinations like this. And the results are exactly the same.
That's what the other Java startup scripts do. There are plenty
of examples.
I know, and I have been investigating a lot by my own. That's way I feel puzzled. I tested with openjdk and sunjdk with same results too. It's a lot weird.
The example:
[olea@lisergia ~]$ /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre/bin/java -cp /usr/share/java/vldocking-2.1.4.jar -jar /usr/share/java/OmegaT.jar 53063: Info: =================================================================== 53063: Info: OmegaT - 2.0.0 (Wed Nov 26 16:16:43 CET 2008) Locale es_ES Exception in thread "main" java.lang.NoClassDefFoundError: com/vlsolutions/swing/docking/DockingDesktop at org.omegat.Main.main(Unknown Source) Caused by: java.lang.ClassNotFoundException: com.vlsolutions.swing.docking.DockingDesktop at java.net.URLClassLoader$1.run(URLClassLoader.java:217) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:205) at java.lang.ClassLoader.loadClass(ClassLoader.java:323) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294) at java.lang.ClassLoader.loadClass(ClassLoader.java:268) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:336) ... 1 more
As you can imagine there are more dependencies but the first error is always for vldocking... which is really in the path!!
Attached is the output with the -verbose flag.
Of course compilation is always succesful, since the build.xml contens the beautiful line:
<pathelement location="/usr/share/java/vldocking.jar"/>
But I think this doesn't affect the runtime linking...
Any suggestion, please? --
Ismael Olea
2008/11/26 Ismael Olea ismael@olea.org:
[olea@lisergia ~]$ /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre/bin/java -cp /usr/share/java/vldocking-2.1.4.jar -jar /usr/share/java/OmegaT.jar
If you're executing a jar file (as above) then the "-cp" argument is ignored entirely. You should put the OmegaT jar on the classpath as well and give the name of the main class in the script instead. I think executing jars is actually officially discouraged in Fedora even ...
MEF
Thanks very much!
After reading your email I've mimic the bsh launch script and now the thing is working as expected.
Thans!
2008/11/26 Mary Ellen Foster mefoster@gmail.com
2008/11/26 Ismael Olea ismael@olea.org:
[olea@lisergia ~]$ /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre/bin/java
-cp
/usr/share/java/vldocking-2.1.4.jar -jar /usr/share/java/OmegaT.jar
If you're executing a jar file (as above) then the "-cp" argument is ignored entirely. You should put the OmegaT jar on the classpath as well and give the name of the main class in the script instead. I think executing jars is actually officially discouraged in Fedora even ...
MEF
-- Mary Ellen Foster -- http://homepages.inf.ed.ac.uk/mef/ Informatik 6: Robotics and Embedded Systems, Technische Universität München and ICCS, School of Informatics, University of Edinburgh
-- fedora-devel-java-list mailing list fedora-devel-java-list@redhat.com https://www.redhat.com/mailman/listinfo/fedora-devel-java-list
java-devel@lists.fedoraproject.org