www1350 / javaweb

http://www1350.github.io/
31 stars 5 forks source link

tomcat、IDEA开启远程断点 #101

Open www1350 opened 7 years ago

www1350 commented 7 years ago

catalina.sh 里面 CATALINA_OPTS后面加上,address=20051

或者

JPDA_TRANSPORT=dt_socket  
JPDA_ADDRESS=20051  
JPAD_SUSPEND=n  

或者

JPDA_OPTS='-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=20051’  

image

如果是springboot

<project>
  ...
  <build>
    ...
    <plugins>
      ...
      <plugin>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-maven-plugin</artifactId>
        <version>1.1.12.RELEASE</version>
        <configuration>
          <jvmArguments>
            -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005
          </jvmArguments>
        </configuration>
        ...
      </plugin>
      ...
    </plugins>
    ...
  </build>
  ...
</project>

mvn spring-boot:run -Drun.jvmArguments="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005"