3 Replies Latest reply: Oct 31, 2012 12:18 PM by user8742475 RSS

    Wildcard for classpath

    user8742475
      I have all my jar files under a directory and I tried the below syntaxes in the classpath section but it won't work. Can we wildcard in classpath?

      I tried different syntaxes as below but no luck

      c:\lib\*

      and

      c:\lib\*.jar

      and

      c:\lib\*.*
        • 1. Re: Wildcard for classpath
          Mohammed Rayan-Oracle
          You can do it by copying all the name of the jars in a file and calling that file using the syntax in your program: -classpath @pathname\filename


          Note:Windows OS has a Classpath Length Limitation: Win32 systems have a 2K limitation on the length of the command line. If the classpath setting for the Windows service startup is very long, the 2K limitation could be exceeded.


          For example:

          set CMDLINE="%JAVA_VM% %MEM_ARGS% %JAVA_OPTIONS%
          -classpath *@c:\myClasspath.txt* -Dweblogic.Name=%SERVER_NAME% -Dbea.home=\"D:\bea_70sp2\" -Dweblogic.management.username=%WLS_USER% -Dweblogic.management.server=\"%ADMIN_URL%\" -Dweblogic.ProductionModeEnabled=%STARTMODE% -Djava.security.policy=\"%WL_HOME%\server\lib\weblogic.policy\" weblogic.Server"


          Refer the section " Adding Classes to the Classpath" in the below link
          http://docs.oracle.com/cd/E13222_01/wls/docs81/adminguide/winservice.html
          • 2. Re: Wildcard for classpath
            user8742475
            Thanks. Yeah, I'm using WLS 10.3.5 on Windows. I did not know about the 2K limitation regarding the command line.

            I need to count the classpath string to see how long it is but it looks very long.
            • 3. Re: Wildcard for classpath
              user8742475
              I put it in the classpath section of the Server Start tab in the Weblogic Administration Console for my server as below

              @c:\myClasspath.txt

              but it failed to start up

              Any ideas?

              Also what is the correct format to specify all the jar files in a directory please?