Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where is the "work" directory located for a Tomcat instance running in Eclipse?

In Eclipse you can configure numerous servers to run inside the IDE, including Tomcat. Depending on your Tomcat configuration, at some point in the life cycle of a webapp your JSP files will get compiled into servlets. These new servlet .class files are stored in the %TOMCAT_HOME%/work directory along with the .java intermediate file created from the JSP. This .java file is very helpful when your JSPs throw exceptions and cite a line number corresponding to the .java and not the .jsp

Update: On my environment (Windows), it is located here:

C:/Documents and Settings/%USER%/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/work

Perhaps to answer more completely somebody could post the location for *nix environments.

like image 982
Robert Campbell Avatar asked Apr 18 '09 16:04

Robert Campbell


People also ask

Where is the Tomcat directory?

The default directory for Tomcat files will be in /usr/local/tomcat9, you can view the configuration files inside the conf folder, the main page that you have seen above, when you open your website on the 8080 port is in /usr/local/tomcat9/webapps/ROOT/.

What is work folder in Tomcat?

The work directory, as its name suggests, is where Tomcat writes any files that it needs during run time, such as the generated servlet code for JSPs, the class files for the same after they are compiled, the serialized sessions during restarts or shutdowns (SESSIONS. ser).

How do I find my Tomcat instance?

A simple way to see if Tomcat is running is to check if there is a service listening on TCP port 8080 with the netstat command. This will, of course, only work if you are running Tomcat on the port you specify (its default port of 8080, for example) and not running any other service on that port.

How do I change the working directory in Tomcat?

You won't be able to change the working directory after tomcat has started. Tomcat's startup scripts (bin/startup.sh and so on) don't set a working directory. The tomcat process will normally inherit whatever the current directory was for the startup script.


1 Answers

You will find it in

projectworkspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0 

This is the default place where Eclipse 3.4 publishes the project. However, this can be changed by changing the settings in your 'Server' view.

like image 89
Parag Avatar answered Sep 17 '22 13:09

Parag