Solved

Problems with Eclipse Java project and the output directory

Posted on 2007-04-06
3
730 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 30

Accepted Solution

by:
Mayank S 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:Mayank S
Mayank S 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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
In this post we will learn different types of Android Layout and some basics of an Android App.
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
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:

728 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