Eclipse buildpath automatically taking all JARs of a internal directory

后端 未结 10 1805
醉梦人生
醉梦人生 2020-12-15 05:34

How do I configure my project buildpath to have a set of .jar files located in the same directory automatically included in the buildpath ? Meaning that adding a new .jar fi

10条回答
  •  没有蜡笔的小新
    2020-12-15 06:21

    On a windows machine you could do what uzhin said with a one liner on the command line.

    Supposing you had set up a variable in Eclipse called AXIS2_HOME that points to c:\javalibs\axis2-1.4.1, this example uses the "for" command to iterate all of the .jar files in the c:\javalibs\axis\lib directory and writes the .classpath nodes a file called addto.classpath. (Note: The carat character ^ escapes the < and > on the command line so they don't do what they usually do.)

    for %i in (c:\javalibs\axis2-1.4.1\lib\*.jar) do @echo     ^  >> addto.classpath
    

    You end up with something like this in the file...

    
    
    
    
    ...
    

    So then you can copy those lines and paste them in the obvious place in the actual .classpath file.

提交回复
热议问题