Here are some of the habits I used to use in my work with Eclipse.

1. The placeholder

When I went to school, I must have met the situation of sitting, where to put a thing, on behalf of sitting. It is said that someone directly put a brick, :).


When you’re writing code, sometimes you’ll write part of it first, and then you’ll worry about more detailed implementation or design and other parts later. But sometimes it is easy to miss, especially when the project is urgent, after the function is tested, the detailed implementation of the matter will fall behind.


There is a built-in feature in Eclipse that makes it easy to bury a logo and see what needs to be added later. Make a hole in the code directly as //FIXME or //TODO.



These holes can be viewed in the Tasks view at any time



If you don’t see this in Eclipse by default, you can open Tasks in the Show View of the Windows menu.


2. Multiple breakpoints


As a popular IDE, Eclipse also supports conditional breakpoints for debugging.



In addition to normal conditional breakpoints, there is support for a breakpoint called Hit count, which breaks when it is “Hit” several times.



In addition, IDE can also add breakpoints for exceptions based on the type of exception, such as the following figure for all null-pointer exceptions





3. Multithreading debugging


In multithreading debugging, the switch between multiple threads in Eclipse does not need to be switched through the drop down like IntelliJ IDEA, you can directly select the corresponding thread in the thread window.



In addition to switching threads, threads in Eclipse can directly see who took our lock, right? Looking at the figure below, the thread with the key identifier holds the lock followed by the name of the lock. After the current thread with the lock releases the lock, the thread in the stepping state will directly acquire the lock and start execution.



Step back


IDEA removes the Frame directly from the thread, which is similar in Eclipse but performs differently. In Eclipse, right click on the Frame to fall back to and select Drop to Frame.



5. File comparison


To compare the differences between two files, you can compare them directly within the IDE, without having to use other comparison tools outside the IDE.

Select the two files you want to Compare and right-click Compare With – Each Other.


6. Run time configuration


Some applications need to specifically configure some JVM parameters and pass in the parameters required by the application to be received by Main’s ARgs array by right-clicking the Class of the project to be Run and then running as


Then select argument from the box that pops up with program parameters above and JVM parameters below. This will also be seen later in Server configuration.





7. Web project Server configuration


For Web projects, you need to configure a running Server in order to debug in the IDE. Take Tomcat as an example, both servers added independently during Run on Server are included here, similar to a Project. Server. XML in Tomcat is the actual configuration information during Run, so port modification can be directly carried out here.



If the following exceptions occur during the runtime, the ports are occupied.



At this point, you can modify server.xml directly, as mentioned earlier, in another way:

Under the Server TAB, double-click the Server to open a configuration page for the Server:



The following figure shows the modified port on the configuration page:



If the process is still running, it may be that the ports are not all modified.


Some projects that are large and take a long time to start may encounter timeout problems. Note that you can modify it here.




Here is the most important point, can be used for the back of the problem investigation and so on

In the upper left of the configuration page, there is a General Information, where you can see some configuration at run time



Here, Open Launch Configuration,


Based on VM arguments, you can learn about the running information of Tomcat and the location of Catalina. base.

PS: Catalina. base is a single Tomcat installation that can run multiple instances with different configurations. You have no idea how Tomcat works in an IDE!


Open the directory corresponding to Catalina. base. In this directory, wTPWebapps is the actual application deployment directory, not the default webapps.



8. Increase Console output


Sometimes the output of the application is too much, and only the back part of the Console output is visible. The front part has been erased. By configuring the attributes of Console, you can enlarge the output space and view more information.

Right-click in the blank area of the Console, select Prefeerences that will pop up, and set buffer size in the open configuration.

You have what use skill, welcome message complement.


Source | real growth | | workplace, here is the “Tomcat those things”

Please leave your footprints, we together “lifelong growth”