Question about setting classpath

Discussion in 'Mac Programming' started by jtalerico, Feb 26, 2006.

  1. jtalerico macrumors 6502

    Nov 23, 2005
    So I have written a java program that uses Commons-Net. Everytime i run my program from the .jar file it errors out telling me it cannot use the Commons-Net, but i have the the commons-net .jar included in the .jar file that i created. But everytime i try to run it, i get errors, what should i do for my classpath? Or what else could it be?
  2. jeremy.king macrumors 603


    Jul 23, 2002
    Fuquay Varina, NC
    I assume you are trying my previous suggestion about the Class-path attribute of the Manifest file? Didn't realize you were looking to bundle it all together...So you basicaly have two options.

    1) unjar the classes in the commons-net into your project and jar everything up together without a jar within the jar.

    2) look into a utility such as One-JAR, which has its own classloader to help...

    Good Luck.
  3. jtalerico thread starter macrumors 6502

    Nov 23, 2005
    Thanks king, ill give it a go!

Share This Page