Solved

Problems with Eclipse Java project and the output directory

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

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

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

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…
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 different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
Suggested Courses

623 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