Including jars in classpath on commandline (javac or apt)

前端 未结 6 1208
礼貌的吻别
礼貌的吻别 2020-11-22 05:44

trying to run this program. I think that to setup all of the web service stuff I need to run apt. (Although using javac I am having the same issue). I think what I am get

6条回答
  •  生来不讨喜
    2020-11-22 06:28

    Use the -cp or -classpath switch.

    $ java -help  
    Usage: java [-options] class [args...]  
               (to execute a class)  
       or  java [-options] -jar jarfile [args...]  
               (to execute a jar file)  
    
    where options include:  
    ...  
        -cp   
        -classpath   
                      A ; separated list of directories, JAR archives,  
                      and ZIP archives to search for class files.  
    

    (Note that the separator used to separate entries on the classpath differs between OSes, on my Windows machine it is ;, in *nix it is usually :.)

提交回复
热议问题