Saturday, October 16, 2010 : 7:37 PM

How do I add a Java classpath in Eclipse?

Ugh. I needed to include a folder in my classpath. I didn't need to include a jar file--that's easy in Eclipse. There are so many answers out there on the 'net about "how easy it is to use Eclipse," that "you don't need to set classpath because Eclipse does it for you." I disagree. If it were so easy, there wouldn't be all of these explanations that still come up short.

Hours after experimenting, fiddling, I finally got it to work the way that I wanted.

To include my folder in the classpath maintained by the Eclipse project, I had to (1) exit Eclipse and (2) hand-modify the .classpath file for the project.

I included this line, where C:\jed is the folder that I wanted in my classpath:

<classpathentry kind="lib" path="C:/jed"/>

For my fellow Java programmers...