Results 1 to 2 of 2
  1. #1
    asdfjklö is offline Member
    Join Date
    Feb 2011
    Posts
    2
    Rep Power
    0

    Default [SOLVED] Classpath with two jars not working

    Hi,

    I got a strange problem. I added my jar file to the classpath:
    Java Code:
    $export CLASSPATH=/home/username/yom/yom-parser/yom-updatedb.jar
    All fine, executing it without a problem
    Java Code:
    $java mypackage.MyClass
    But I need to use an additional, which I add:
    Java Code:
    $export CLASSPATH=/home/username/yom/yom-parser/yom-updatedb.jar:/home/username/yom/yom-parser/lib/mysql-connector-java-5.1.3-rc-bin.jar
    After doing so, my class can no longer be executed however.
    Java Code:
    $java mypackage.MyClass
    Java Code:
    Exception in thread "main" java.lang.NoClassDefFoundError: mypackage/MyClass
    Where's the problem? Also tried ; instead of : in the classpath, no help.
    Last edited by asdfjklö; 02-03-2011 at 11:02 AM.

  2. #2
    asdfjklö is offline Member
    Join Date
    Feb 2011
    Posts
    2
    Rep Power
    0

    Default

    Nevermind, solved it. The classpath was fine, just oversaw a dependency which was done automatically by eclipse, so a classfile in the jar was missing.

Similar Threads

  1. Adding jars at runtime
    By tbar0711 in forum Enterprise JavaBeans (EJB)
    Replies: 0
    Last Post: 02-17-2010, 08:25 PM
  2. Communication between two Jars
    By Gijava in forum Advanced Java
    Replies: 1
    Last Post: 06-26-2009, 05:59 PM
  3. Replies: 0
    Last Post: 08-19-2008, 05:44 PM
  4. Preblem with JARs
    By bizmut in forum Eclipse
    Replies: 1
    Last Post: 06-04-2008, 06:41 PM
  5. Adding JARs to the classpath at runtime?
    By johann_p in forum Advanced Java
    Replies: 1
    Last Post: 06-26-2007, 11:42 PM

Tags for this Thread

Posting Permissions

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