Solved

Problems with Eclipse Java project and the output directory

Posted on 2007-04-06
3
722 Views
Last Modified: 2013-12-15
I setup a new project in Eclipse to work out of a previous SVN project checkout of a web application.  I set the default output directory to WEB-INF/classes/.  I'm having two problems with this setup:

1) I have a log4j.properties file that is versioned and inside the WEB-INF/classes.  When I open eclipse, because WEB-INF/classes is the default output directory it removes the log4j.properties file.

2) Since Eclipse by default hides the output folders for the project, I'm not able to access and manage the log4j.properties file.  How do I make this visible in the Java perspective?

I suspect a solution you will suggest is to place the log4j.properties file inside the src directory, top-level, because it will then be placed inside the WEB-INF/classes directory.  However, this seems to be a "hack" for dealing with eclipse, and I'd rather not have duplicate log4j.properties files in two places.

If the location for the log4j.properties file is supposed to be in the WEB-INF/classes directory, it doesn't make much sense to me to store this in the src file and manage it there.

Do you have any suggestions on how to deal with this problem?  What do you usually do when using log4j in Eclipse webapp projects?  (I would prefer not installing a third-party webapp plugin into Eclipse.)
0
Comment
Question by:ctangent
  • 2
3 Comments
 
LVL 30

Accepted Solution

by:
mayankeagle earned 500 total points
ID: 18865807
You can place the log4j.properties file under any source directory that you have. For example, if you have a structure src\com\yourCompany\projectName\moduleName\startup\log4j.properties, it will automatically goto classes\yourCompany\projectName\moduleName\startup\log4j.properties after building.
0
 
LVL 30

Assisted Solution

by:mayankeagle
mayankeagle earned 500 total points
ID: 18865820
You would prefer managing one folder - either src or classes - its better to manage src obviously because you have the source code there and will be making changes to it. They will be reflected in the classes folder once you save and build.
0
 

Author Comment

by:ctangent
ID: 18866464
Thank you, that actually will work well.
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Update (December 2011): Since this article was published, the things have changed for good for Android native developers. The Sequoyah Project (http://www.eclipse.org/sequoyah/) automates most of the tasks discussed in this article. You can even fin…
Jaspersoft Studio is a plugin for Eclipse that lets you create reports from a datasource.  In this article, we'll go over creating a report from a default template and setting up a datasource that connects to your database.
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now