Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

While developing a Java project, I place all of my jar files in a folder, created within my project, called libs. Now, is there a way to add my libs folder to the Java class path so that I do not have to add each individual jar?

I was thinking something along the lines of a variable or creating a user library.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
198 views
Welcome To Ask or Share your Answers For Others

1 Answer

Based on what you've said, I would probably create a user library containing your library JARs.

You can create a User Library with Window => Preferences, drill down to Java => Build Path => User Libraries. => Then choose New, and give your library a name => Then add the JARs you want.

Then you can add all the JARs to the classpath of any project you have by right-clicking on the project => Add Libraries => User Libraries, and selecting your library.


Update; to have Eclipse dynamically add .jar files you drop into a folder to your project classpath, you need a plugin called Library Folder ClasspathContainer. Follow these instructions and you're in business.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...