It is best to do a breakpoint during project development ~ Eclipse is not comparable to myeclipse in this regard.
So we can't break points, right? Now, when my colleagues in the project use breakpoints, I naturally need to use them. 'some problems are recorded during the setup process!
Steps:
1. Use the compiler to open startweblogic. CMD in the Weblogic project directory, and add this sentence to it:
Set java_options = % java_options %-xdebug-xnoagent-djava. compiler = none-xrunjdwp: Transport = dt_socket, address = 8888, Server = Y, suspend = N
2. In eclipse
Right-click the project name and choose debug as-Debug configurations... -Select your project under remote Java application-set localhost 8888 under connect properties. The port corresponds to the address above.
3. Start the server, right-click the project name, debug as-Debug configurations...-click the debug button!
In theory, we can break the point!
PS: but here I am reporting an error:
"Unable to install breakpoint due to missing line number attributes, modify compiler options to generate line number attributes"
Summary of solutions found when this error occurs:
1. When ant is used for compiling, the debug switch is not enabled. When writing a javac task, check that DEBUG = true; otherwise, debugging cannot be performed. The settings for the eclipse compiler don't affect the ant build and even if you launch the ant build from within eclipse. ant controls it's own compiler settings. you can tell ant to generate debugging info like this 'javac... DEBUG = "true "... />
2. For compiler settings, window-> preferences-> JAVA-> compiler checks all line number attributes to generated class files in the classfile generation area on the compiler start page. If this option is already selected, apply it again. You can also set it at the project level. Choose Project Properties> Java compiler on the start page.
The error reported by eclipse is caused by these two reasons.
The first point is the default version of Eclipse, which does not need to be changed! The second point is that the compilation of java files during ant deployment does not have the DEBUG = "true" attribute!
Add it and re-compile and deploy the startup server. Click debug to run the project, and you will be able to perform breakpoint debugging normally!