Eclipse Common Operations (reprint)

Source: Internet
Author: User
Tags tomcat server

HTML code
  1. 1.Eclipse Character Set settings:
  2. Search enc, and then search to the configuration screen, the css,html,jsp,xml,workspace of all the default code is changed to UTF-8
  3. 2.jrebel4.0.1 use
  4. 3. If the runtime prompts for insufficient memory, add the following JVM parameters
  5. -xmx768m
  6. -xx:maxpermsize=128M
  7. 4. Automatic Formatting
  8. java->code style->formatter
  9. Indentation:tabsize 4;tab Plicy:tabs only
  10. Line Wrapping:maximum line width 120;
  11. java->editor->save actions->format Source code,organize imports
  12. 5. The JRE used
  13. java->installed jres-> select the JDK or JRE to use
  14. 6. Disabling plugins that are not required
  15. Window-> Preferences-> General-> StartUp and Shutdown (note do not remove JavaServer Faces Tools-core, this plugin and HTM L Auto Prompt related)
  16. 7. Install the plugin:
  17. Propedit http://propedit.sourceforge.jp/eclipse/updates/
  18. Jd-eclipse http://java.decompiler.free.fr/jd-eclipse/update
  19. Pydev http://pydev.org/updates
  20. SVN http://subclipse.tigris.org/update
  21. Easy Explorer http://easystruts.sourceforge.net/eclipse/updates/site.xml (download failed, directly put org.sf.easyexplore_1.0.4. Jar to the plugins directory, then reboot)
  22. Implements Http://eclipse-tools.sourceforge.net/updates/
  23. WordWrap http://ahtik.com/eclipse-update/
  24. 8. Set the code and HTML content of the automatic prompt shortcut key ctrl+space, and the input method of the shortcut key Ctrl+space changed to other
  25. window->preferences-> enter "Keys" in the search box, double-click it after you find the keys, and in the search box on the right, enter "context information" to find "context  Information "(Automatic hints for HTML), enter" content Assist "to find" content Assist "(Automatic hints for Java code), and set the shortcut key Ctrl Space.
  26. 9.window->show view->navigator View menu->filters *.class. *
  27. 10.window->show view->console
  28. 11. Adjust font and text size window->preferences->general->appearance->colors and fonts-> basic->text font->edit,
  29. 12.Ctrl H, Ctrl T (see Inheritance structure of Class),
  30. 13.Java file Right->show inbreadcrumb-> Theheader of the editor displays the path information associated with the current class file
1.Eclipse Character Set: Search enc, then search to the configuration screen, put Css,html,jsp,xml, Workspace All default codes are changed to utf-82.jrebel4.0.1 use 3. If the runtime prompts for insufficient memory, add the following JVM parameter-xmx768m-xx:maxpermsize=128m4. Automatic Formatting Java->code Style->formatter indentation:tabsize 4;tab plicy:tabs only line wrapping:maximum line width; java->e Ditor->save actions->format Source code,organize imports5. JRE java->installed jres-> used  Select the JDK or JRE6 you want to use. Disable unwanted plug-ins windows, Preferences, General, StartUp and Shutdown (note do not remove JavaServer Faces Tools -Core, this plugin and HTML auto hint related) 7. Install plugin: Propedit http://propedit.sourceforge.jp/eclipse/updates/jd-eclipse Http://java.deco Mpiler.free.fr/jd-eclipse/update Pydev http://pydev.org/updates SVN http://subclipse.tigris.org/update Easy EXPL Orer http://easystruts.sourceforge.net/eclipse/updates/site.xml (download failed, put Org.sf.easyexplore_1.0.4.jar directly into the plugins directory , and then restart) implements Http://eclipse-tools.sourceforge.net/updates/WordWrap HTTP://AHTIK.COM/ECLIPSE-UPDATE/8. Set code and HTML content automatic prompt shortcut key ctrl+space, and the Input method shortcut key Ctrl+space change to other window->preferences-> enter "Keys" in the search box, find the keys and double-click on it, and in the search box on the right, enter " Context Information "Find the context information" (Automatic hints for HTML), enter "content Assist" to find "content Assist" (Automatic hints for Java code), and set the shortcut key Ctrl Space. 9.window->show view->navigator View menu->filters *.class. *10.window->show View-> Console11. Adjusting font and text size window->preferences->general->appearance->colors and Fonts->basic->text Font->edit, 12.Ctrl H, Ctrl T (see Inheritance structure of Class), 13.Java file right-->show in breadcrumb-> the header of the editor displays the path information associated with the current class file

External projects run in Eclipse: servers-> Select a server-> right-click->modules->add External Web Module Specify the server path for server Tomcat in Eclipse, the Deploy path servers-> Select a server-> right-->overview->server location, specify the path to the Tomcat server (such as Catalina.base), and the Deploy Path
Common projects project import, Export Operation Export War file (with src) Import War File New->java Project from Existing Ant buildfile import->existing Projects into Wor KSpace import->file System
Eclipse Error, you can try eclipse.exe-clean
Eclipse cannot identify the original project with a dynamic WEB project: project→ right "Properties" → Select Project Facets from the list on the left → Tick the "Dynamic Web Project" on the right, and note that the correct version (version WebApp in Web. xml) is selected and set: further configuration available. Then select the Web project when compiling the publish settings, such as the W Project Default Web folder for Web,class under the default copy of the resource file to web-info/classes/, The value of the associated setting is saved in the Org.eclipse.wst.common.component file under the project's. Settings directory.

XML code
  1. <? XML version= "1.0" encoding="UTF-8"?>
  2. <project-modules id="Modulecoreid" project-version="1.5.0">
  3. <wb-module deploy-name="prj">
  4. <wb-resource deploy-path="/" source-path="/web" tag= "defaultrootsource"/ >
  5. <wb-resource deploy-path="/web-inf/classes" source-path="/src/java"/>
  6. <wb-resource deploy-path="/web-inf/classes/resources" source-path="/src/resources" />
  7. <wb-resource deploy-path="/web-inf/classes/conf" source-path="/src/conf"/>
  8. <property name= "context-root" value="prj"/>
  9. <property name= "java-output-path" value="/prj/target/classes"/>
  10. </wb-module>
  11. </project-modules>
<?xml version= "1.0" encoding= "UTF-8"? ><project-modules id= "Modulecoreid" project-version= "1.5.0" >    <wb-module deploy-name= "prj" >        <wb-resource deploy-path= "/" source-path= "/web" tag= "Defaultrootsource" />        <wb-resource deploy-path= "/web-inf/classes" source-path= "/src/java"/><wb-resource deploy-path= "/web-inf/classes/resources" source-path= "/src/resources"/><wb-resource deploy-path= "/WEB-INF/classes/conf "Source-path="/src/conf "/>        <property name=" Context-root "value=" prj "/> <property name=        " Java-output-path "value="/prj/target/classes "/>    </wb-module></project-modules>

After eclipse started the server, it was discovered that eclipse did not actually load the Dynamic Web project in:Select the appropriate server->add and remove-> to remove the corresponding item and reload it again to start the success
If the install new software installation fails, you can try the Eclipse Marketpalce installation, or manually go to the official website to download the zip file, overwrite the Eclipse directory, and then use the install new Software installation, at this time, because the local file already exists, will not go to the official website to download, will soon be able to install the completed Eclipse->help->eclipse Marketplace
Word Search\b Search for words\b, then select Regular expression, then search
Pydev Plug-in configurationWhen installing the Eclipse plugin online, the installation will often fail due to network or other reasons, and you can proceed with the installation as follows: Help->install New software, in the popup screen, work With drop-down box select the plugin URL that you just installed, click Next to continue the installation
Uninstall unwanted or install the wrong plugin to uninstall plugins go to the About dialog and click on Configuration. All your did is remove the places where Eclipse looks for new plugins to install. Help->about eclipse->installation details->installed Software->subclipse->uninstall->finish And then re-install it through Help->install software.
Debug debug: Sometimes in the debugging, Inspect,display and watch expressions under the value, this time can openVariables interface, the default class and method parameters are displayed! At the same time on the variables page, debugging can beDynamically modify the value of a variable! In the Debug view, clickJava->show qualified Names, the package name of the class that displays the stack interface various breakpoints: line breakpoint Watchpoint [access and modification] hit C          Ount [suspend VM or thread] Condition breakpoint [true or value changed] Method breakpoint [Entry] Exception breakpoint [Caught and Uncaught] class Load breakpoint [class loader]
Eclipse debugging, sometimes need to debug the class is not in the project scope, such as Org.apache.jasper.runtime.HttpJspBase.service, this time only need to put the Tomcat source code as a project to import, or with an exception breakpoint Or in the debug interface to find the call stack information, and then hit the Popup Class screen breakpoint (class file break point is not good to hit, because after playing because you do not see the hit, this time using the right mouse button, Toggle breakpoint break point will be more convenient! Note that the breakpoint symbol is not visible on the Eclipse class screen, but the breakpoint has been hit (visible in the Breakpounts view), and the value of the variable cannot be viewed in the class interface (variables view can be viewed!). )
Eclipse exception Breakpoint: In Eclipse breakpoints View, the top right corner has a button calledADD Java Exception Breakpoint, on the popup page you can enter the exception to be caught and suspend on caught exceptions and suspend on Uncaught exceptions! (The general choice is to pause when the exception is caught,In the debug view, you can see the call stack information when the error occurs!   The related error is at a glance! This captures the specific exception, as if the parent class cannot capture the exception that occurs with the subclass, such as with throwable!!! Also in the Breakpoints view you can add:ADD Script Loader Breakpoint, grouping breakpoints (by breakpoint, by project, etc.), showing the package name of the class
Code hot Swap, Drop to frame, breakpoints, etc. are the capabilities of the JVM, in the Debug interface thread, right-->properties the screen, you can see the parameters passed by the JVM and the capabilities of the JVM Eclipse debugging: Code hot substitution, Currently found in the remote debugging, when the corresponding code on the access page is modified and saved locally, once again to visit the page, found to have played a role! At this point, if you restart the server, there is found that the results are still old! Replace the relevant file before it is formally replaced.
Re-debug (Drop to frame): fallback in the stack frame of the current thread, saying that it can only be bounced back to the beginning of the invocation of the current thread. In the debug stack page, right-click on the thread method that needs to be rolled back, select "Drop to Frame"
Conditional breakpoint: Right-click on the breakpoint, select Breakpoint Properties, select the condition in the popup screen, and enter the expression variable name = = 4 (bool judgment), note that in debugging non-local, such as debugging tomcat internal source code, the expression often does not work, There is no solution for the moment!
ServletRequest when debugging, the value of the URL-dependent variable is in coyoterequest
The source code for Rt.jar in Java is specified: Installed JREs, Java, Window, Preferences, select Rt.jar in the pop-up screen, click the button source Attachment Specify src.zip OK to the Java directory by default, in order to reduce the size of the Rt.jar package, the Rt.jar package compiles without information such as debug, so debugging is not possible in the Rt.jar ( by downloading the Java version containing compilation information (Specify the parameter-G), or recompile the Rt.jar package to resolve), refer to:

Eclipse Common Operations (reprint)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.