Whitespaces in CLASSPATH

前端 未结 1 1193
予麋鹿
予麋鹿 2020-12-15 09:28

I am working on a Windows PC and have cygwin on it! I have organized all my jars under a directory within a few directories! I am writing a bash script to set t

相关标签:
1条回答
  • 2020-12-15 10:25

    See this article.

    You could enclose either the full classpath in double qoutes

    java -classpath "C:/Documents and Settings/user/project/lib/axis.jar; C:/Documents and Settings/user/project/lib/axis-ant.jar;" TestClient
    

    or each jar in your classpath

    java -classpath "C:/Documents and Settings/user/project/lib/axis.jar"; "C:/Documents and Settings/user/project/lib/axis-ant.jar;" TestClient
    

    In your case something like that:

    for JAR_FILE in `ls *.jar`
    do
        CLASSPATH="$DIRECTORY_TO_LOOK_FOR_JARS/$JAR_FILE":$CLASSPATH
    done
    

    Hard to see, but I moved the closing double qoute.

    0 讨论(0)
提交回复
热议问题