Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the Eclipse skills to improve work efficiency?

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article shows you what skills to use Eclipse to improve your productivity. The content is concise and easy to understand. It will definitely brighten your eyes. I hope you can get something through the detailed introduction of this article.

This time, let's introduce some habits that I often use in my work with Eclipse. Please leave a comment.

1. Take up a place

I must have encountered the situation of seating when I was at school. If I put something somewhere, it means that I have occupied a seat. It is said that someone put a brick directly.

When writing code, you may sometimes write a part first, and then consider other parts such as a more detailed implementation or design. But sometimes it is easy to miss, especially when the project is urgent, the function is mentioned and tested, and the detailed implementation is left behind.

There is a built-in function in Eclipse, which makes it easy to bury a logo and check what needs to be added later. Take a seat in the code directly in the form of / / FIXME or / / TODO and bury a hole.

These buried pits can be viewed at any time in the Tasks view.

If you don't see this by default in Eclipse, you can find Tasks in the show view of the Windows menu to open it.

two。 Multiple breakpoints

As a commonly used IDE,Eclipse, conditional breakpoints are naturally supported in Debug.

In addition to normal conditional breakpoints, there is also support for a breakpoint called Hit count, which breaks when the breakpoint is "hit" several times.

In addition, breakpoints for exceptions in IDE can also be added directly according to the exception type. For example, the following figure adds breakpoints for all null pointer exceptions.

3. Multithreaded debugging

In multi-thread debugging, the switching 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, the threads in Eclipse can directly see who has taken our lock? Look at the figure below. The thread with the key identification holds the lock, followed by the name of the lock. After the lock is released by the thread that currently has the lock, the thread in the stepping state directly acquires the lock and starts execution.

4. Which step back to?

In IDEA, the Frame on the thread is deleted directly. In Eclipse, the meaning is similar, but the execution is different. In Eclipse, right-click on the Frame you want to fallback to, and select Drop to Frame.

5. File comparison

To compare the difference between the two files, you can compare them directly in IDE, without the need to use other comparison tools outside IDE.

Select the two files to compare and right-click Compare With-"Each Other.

6. Run-time configuration

Some applications need to configure some JVM parameters and pass in some parameters needed by the application to be received by the args array of main. You can right-click the Class of the project to be run, and then Run as

Then select argument in the pop-up box, with the program parameters above and the JVM parameters below. You will also see these later in the Server configuration.

7. Web project Server configuration

For Web projects, in order to debug in IDE, you need to configure a running Server. Take Tomcat as an example. The Server added independently during Run on Server is all included here, similar to a Project. The server.xml in the corresponding Tomcat is the configuration information of the actual runtime, so you can modify the port directly here.

If you encounter the following exception at run time, it is obviously the problem of port occupancy.

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

Under the Server tab, double-click the Server, and a configuration page for the corresponding Server opens:

Modify the port on the configuration page as shown below:

Therefore, after general modification, it is still prompted that the port is occupied, either the process is still running, or it may be that the port has not been all modified.

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

The most important point here is that it can be used for troubleshooting and the like.

At the top left of the configuration page, there is a General Information, where you can see some of the configurations at run time

Here, Open launch configuration.

Through VM arguments, you can know the specific location of the running information catalina.base corresponding to the current Tomcat.

PS: what is catalina.base? as mentioned in an earlier article, only one Tomcat is installed locally, but multiple instances can be run according to different configuration information. Refer to this article: you must not know how Tomcat works in IDE!

Open the directory corresponding to catalina.base, where wtpwebapps is the real application deployment directory, not the webapps used by default. Please note.

8. Increase Console output

Sometimes the output information of the application is more, at this time, the output of Console can only see the latter part, and the front has been brushed out. By configuring the properties of Console, you can increase the output space and see more information.

Right-click in the empty space of Console, select the pop-up Prefeerences, and then set buffer size in the open configuration.

What are the skills of using Eclipse to improve work efficiency? have you learned any knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report