1 Reply Latest reply on Apr 10, 2006 5:04 PM by 843844

    Setting to many jars in classpath

      I am having a tough Q ahead me. Suppose my application uses some 50 jar found in c:\jars folder. now in classpath i have to set all the jars one by one e.g. c:\jars\1.jar;c:\jars\2.jar;c:\jars\3.jar ...etc. Now adding 50 jars and again accessing all those jars from Classpath from a java file gives classpath too long error. is there any way to resolve it?
        • 1. Re: Setting to many jars in classpath
          Using Class-Path manifest entry is one way to deal with this problem. Do the following:

          vi manifest
          It should contain the following:
          Class-Path: 1.jar 2.jar 3.jar ...

          jar cvf cvfm all_jars.jar manifest

          Copy this all_jars.jar to c:\jars dir.

          Now you can run your app using only c:\jars\all_jars.jar in classpath.

          For more info on this, refer to http://java.sun.com/j2se/1.5.0/docs/guide/jar/jar.html#Main%20Attributes