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.
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/.
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).
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With