How do I add a directory to the eclipse classpath?
In Eclipse, there is a build classpath and a runtime classpath. There is also the build output location, which by default is bin
. You don't want to add resources directly to bin
because Eclipse can delete its contents when doing a clean build. What you need to do is add a resources
folder in your project to contain any non-Java files that you want included in your build output.
To include the contents of this resources
folder in the build output (bin
), right-click the project and select Properties. In the Project Properties, select the Java Build Path section, then the Source tab.
Use the Add Folder... button to select the resources
folder from your project, then OK to save the changes. At that point, Eclipse will automatically copy everything from resources
into bin
when it builds.
Follow these steps to get this issue fixed:
- Right click on Project
- Click on Run As and select Run Configurations
- Click on the classpath tab (Oxygen Eclipse)
- Click on user entries
- Click on Add External JARs.. and choose the downloaded JAR file
- Click Apply and run your project...
This is for a maven project:
- Right click on project
- click on run configurations
- click on the classpath tab (Oxygen Eclipse)
- click on user entries
- click on Advanced
- first radio selection default should be 'Add Folders'
- click OK