Solved

Problems with Eclipse Java project and the output directory

Posted on 2007-04-06
3
728 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
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…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

730 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