Eclipse, Tomcat project root context - eclipse folder

I had a little problem setting up my Tomcat Project. In short, I'm working on a Dynamic Web Page project, but there seems to be some confusion about where I start the application from.

Running the following code

File f = new File(""); System.err.println(f.getAbsolutePath()); 

prints C:/Eclipse where Eclipse starts. I usually expect this to be the output directory, but this time it is not.

My eclipse project is configured to have myProject / WebContent / WEB-INF / classes as the output folder

How to configure the desired directory? Right now I need to use absolute paths that will not work for all project members.

+6
source share
1 answer

Ok, I found a solution.

It seems that my default desktop was installed in my eclipse folder for the project, so I solved it by specifying the project root folder instead, which is usually the case.

I configured it here:

Launch Configurations> Apache Tomcat Launch Configuration> Arguments tab, in the "Working Directory" section, select "Other" and specify the directory.

Thanks for your comments!

+11
source

Source: https://habr.com/ru/post/912847/


All Articles