Solved

Problems with Eclipse Java project and the output directory

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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
PHPStorm debugging issues 1 56
MySQL  on Tomcat 8 69
hibernate jars 4 45
Best environment for cross platform web development? 5 55
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.
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
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…
The viewer will learn how to implement Singleton Design Pattern in Java.

829 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