Results 1 to 3 of 3
Hello,
when i run this .sh-script:
Code:
#!/bin/bash
java -Xmx256M -classpath sapConnector.jar:lib/GenericConnector.jar:lib/SAPmdi.jar com.itellium.dwh.osg.sap.impl.OSGSapConnectorImpl
I get the following Exception:
Code:
Exception in thread "main" java.lang.NoClassDefFoundError: com.itellium.dwh.osg.sap.impl.OSGSapConnectorImpl
at gnu.java.lang.MainThread.run(libgcj.so.81)
Caused by: java.lang.ClassNotFoundException: ...
- 10-06-2009 #1Just Joined!
- Join Date
- Oct 2009
- Posts
- 3
Exception when running a java application through a shell-script
Hello,
when i run this .sh-script:
I get the following Exception:Code:#!/bin/bash java -Xmx256M -classpath sapConnector.jar:lib/GenericConnector.jar:lib/SAPmdi.jar com.itellium.dwh.osg.sap.impl.OSGSapConnectorImpl
The classpath should be ok, because i have a similar shell-script running on a windows-machine (.bat).Code:Exception in thread "main" java.lang.NoClassDefFoundError: com.itellium.dwh.osg.sap.impl.OSGSapConnectorImpl at gnu.java.lang.MainThread.run(libgcj.so.81) Caused by: java.lang.ClassNotFoundException: com.itellium.dwh.osg.sap.impl.OSGSapConnectorImpl not found in gnu.gcj.runtime.SystemClassLoader{urls=[], parent=gnu.gcj.runtime.ExtensionClassLoader{urls=[], parent=null}} at java.net.URLClassLoader.findClass(libgcj.so.81) at gnu.gcj.runtime.SystemClassLoader.findClass(libgcj.so.81) at java.lang.ClassLoader.loadClass(libgcj.so.81) at java.lang.ClassLoader.loadClass(libgcj.so.81) at gnu.java.lang.MainThread.run(libgcj.so.81)
I am not good with linux-systems, so is there some syntax error in the script?
- 10-06-2009 #2
I don't mean to bash gcj, but I have never had good luck having java code run with it properly. I would suggest trying a different JDK, you could use sun jdk or openjdk. Also, I have better luck setting the CLASSPATH environment variable with the jars being used.
- 10-07-2009 #3
It is a classpath problem. If you compiled this code using the Sun JDK and are executing it w/ the GNU JRE, that's probably your problem. Either run it using the Sun JRE or re-compile using gcj.


Reply With Quote