Skip to main content

How do I add logging.properties to the classpath of an Eclipse project?



I'm using Eclipse 3.7.1 and my code isn't seeing my logging.properties file. (I thought it would see it automatically because it is in the standard place within the JRE but that is apparently wrong). I've been told I need to add this file to the root of the classpath but I'm not sure how to do that.





Eclipse gives me ways to add jars, libraries, variables and other things to the classpath but I don't know how to add a properties file. Can anyone clue me in? You'd think it would be easier to add a simple text file than to add a jar but I don't see any options for text files or property files so I'm not sure how to proceed.


Comments

  1. Right click on your project->Run/Debug Settings->Edit the launch configuration you are using->Switch to Classpath tab->Right Click User Entries->Add the Folder (or External Folder) containing your properties file->Click Apply . I am assuming you are referencing to a console application here.

    If you put the properties file in the root level of the project (that's where the project folder is created), then it should be automatically included in the class path.

    You should know that a CLASSPATH never includes specific files. It generally includes folders, jars, etc.

    ReplyDelete

Post a Comment

Popular posts from this blog

Wildcards in a hosts file

I want to setup my local development machine so that any requests for *.local are redirected to localhost . The idea is that as I develop multiple sites, I can just add vhosts to Apache called site1.local , site2.local etc, and have them all resolve to localhost , while Apache serves a different site accordingly.