Find the answer to your Linux question:
Results 1 to 3 of 3
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Exception when running a java application through a shell-script


    when i run this .sh-script:
    java -Xmx256M -classpath sapConnector.jar:lib/GenericConnector.jar:lib/SAPmdi.jar
    I get the following Exception:

    Exception in thread "main" java.lang.NoClassDefFoundError:
    Caused by: java.lang.ClassNotFoundException: not found in gnu.gcj.runtime.SystemClassLoader{urls=[], parent=gnu.gcj.runtime.ExtensionClassLoader{urls=[], parent=null}}
       at gnu.gcj.runtime.SystemClassLoader.findClass(
       at java.lang.ClassLoader.loadClass(
       at java.lang.ClassLoader.loadClass(
    The classpath should be ok, because i have a similar shell-script running on a windows-machine (.bat).

    I am not good with linux-systems, so is there some syntax error in the script?

  2. #2
    Linux Guru coopstah13's Avatar
    Join Date
    Nov 2007
    NH, USA
    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.

  3. #3
    Linux Engineer Thrillhouse's Avatar
    Join Date
    Jun 2006
    Arlington, VA, USA
    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.

  4. $spacer_open

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts