tom
tom

Reputation: 5001

Adding a file to the class path

I have a comment written in the code i am working on which says the filename can reside anywhere in the class path

how do i add the filename/file to this classpath in eclipse?

thanks

Upvotes: 0

Views: 287

Answers (2)

Andreas Dolk
Andreas Dolk

Reputation: 114767

Assuming, you have a standard Java project, create the file inside the src folder. Files in this folder are "on the classpath".

Upvotes: 0

ssedano
ssedano

Reputation: 8432

In the project there is a file called .classpath with entries like:

<classpathentry kind="src" output="target/classes" path="src/main/java"/>

Just adapt it to your needs.

Graphically you can do it through the project properties -> build path -> source's tab.

Upvotes: 1

Related Questions