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

前端 未结 7 879
隐瞒了意图╮
隐瞒了意图╮ 2021-01-31 03:42

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 J

相关标签:
7条回答
  • 2021-01-31 03:47

    You can change it by setting scratchDir parameter in web.xml configuration of your server (in Servers project, not in your application web.xml!).

    0 讨论(0)
  • 2021-01-31 03:48

    If you're using the Tomcat Maven Plugin in Eclipse, then your Tomcat related files would be in <project folder>/target/tomcat instead, including the tomcat work folder at <project folder>/target/tomcat/work, and you can descend from there to find your jsp .java files, etc.

    (I know this may not apply to everyone, but since Tomcat Maven Plugin is a popular way to develop with tomcat and using maven to manage dependencies and help with the build process, I hope this info may be helpful for some people).

    0 讨论(0)
  • 2021-01-31 03:57

    The easiest way is most likely to ask a compiled JSP page about the source of the byte code.

    From http://www.exampledepot.com/egs/java.lang/ClassOrigin.html:

    // Get the location of this class
    Class cls = this.getClass();
    ProtectionDomain pDomain = cls.getProtectionDomain();
    CodeSource cSource = pDomain.getCodeSource();
    URL loc = cSource.getLocation();  // file:/c:/almanac14/examples/
    

    Hopefully this helps. What is it you want to do?

    0 讨论(0)
  • 2021-01-31 04:04

    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.

    0 讨论(0)
  • 2021-01-31 04:04

    Go to "Servers" window -> double click on your tomcat instance -> clik "Open launch configuration" -> go to "Arguments" tab.

    Look for variable definition like this:

    -Dcatalina.base="/Users/dirtyaffairs/Documents/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0"
    
    0 讨论(0)
  • 2021-01-31 04:08

    I assume it would be the same location relative to your workspace.

    0 讨论(0)
提交回复
热议问题