"Reprint" Eclipse use Getting Started tutorial

Source: Internet
Author: User
Tags html form svn jboss

Speaking of Java IDE, catchy is just eclipse, if you can skilled eclipse, for us to write Java program will play a multiplier effect, greatly improve our efficiency. So in this blog post, I'm only new to beginners in Java, so that they can master eclipse as quickly as possible.
1. Common shortcut keys
This is the first step to use the tool, skilled use of shortcut keys for our program will play a considerable help, so here the author listed the shortcut key suggestions must be mastered.
Ctrl + left mouse button (class, method, attribute variable noun): Position tracking the location of a variable declaration or definition
Ctrl + S: Save current file
Ctrl + X: Cut
Ctrl + C: Copy
Ctrl + V: Paste
Ctrl + D: Delete the current row
Ctrl + F: Find/replace (current edit window)
Ctrl + H: Global Search
Ctrl +/: Comment on the current line or multiple lines of code
Ctrl + Shift + C: Comment on the current line or multiple lines of code
Ctrl + Shift + F: Formatting the current code
Ctrl + Shift + O: The missing import statement is added and the extra import statement is deleted (first position the cursor on the class name of the package to be imported)
Ctrl + Shift + S: Save All Files
Ctrl + Shift + X: Turns the currently selected text all uppercase
Ctrl + Shift + Y: Turns the currently selected text all lowercase
Alt +/: Code Intelligence Tips
Alt + Shift + R: rename (including file name, class name, method name, variable name, etc., very useful)
Alt + Shift + J: Generate a comment for a class or method
Alt + Shift + S: Open the source window (generate get, set method, implement, overwrite interface or class method, very common)
Alt + Shift + D, J: Executes the code in debug mode if there is a Main method entry
Alt + Shift + X, J: Executes the code in run mode if there is a Main method entry
 
 
2. Plugin recommendation
Eclipse is a pure version by default, so the functionality is simple, and the most powerful open source IDE is a variety of plug-ins, through the use of plug-ins can help us reduce the amount of code to write the workload, but also help us reduce the difficulty of writing code, so know how to install the necessary plug-ins, is also proficient in the use of the IDE's forensic evidence.
①hibernate Tools
Hibernate Tools is a new and complete set of tools for Hibernate3, which contains the Eclipse plug-in and the ant compilation process, and is the core component of JBoss tools. Using this plugin can greatly reduce the amount of work we use Hibernate, and support the automatic generation of all hibernate XML files, JavaBean, HTML form files, etc.
installation Address: http://download.jboss.org/jbosstools/updates/development/indigo/
②spring IDE
The Spring IDE is the recommended Eclipse plugin on the spring Web site, providing hints, validations, and visualizations of the bean definition files in the development of spring, as well as a visual view of the dependencies between the individual beans. Provides strong support for project development based on spring framework.
installation Address: http://dist.springsource.com/release/TOOLS/update/e3.6/
③subclipse
Subclipse is an eclipse-based SVN plugin that supports all versions of Eclipse, and the team develops the necessary plugins.
installation Address: http://subclipse.tigris.org/update_1.8.x
④findbugs
FindBugs is an Eclipse plug-in tool that can statically parse the source code for possible bugs. It examines the class or jar file and compares the bytecode to a set of defect patterns to identify possible problems. With this tool, the software can be analyzed without actually running the program. It can help improve the quality of your code.
installation Address: http://findbugs.cs.umd.edu/eclipse/
⑤sysdeo Tomcat Launcher Plugin
The sysdeo Tomcat Launcher plugin is Tomcat's eclipse plugin that helps us automate the deployment of Tomcat servers. The plugin is not a necessary plugin and can not be installed.
: Http://www.eclipsetotale.com/tomcatPlugin/tomcatPluginV33.zip
 
plug-in installation method
There are about three ways to install plugins:
The first: Know the address of the online installation. Eclipse→help→install New Software ... → Enter the installation address in the Address bar (work with) → Check the plugin to install →next→ agree to install the protocol →finish→ wait for installation complete → Restart eclipse as required
The second type: Manually download the plugin from the official website and integrate it manually with Eclipse. The general idea of this approach is to close eclipse, then unzip the downloaded plugin, copy it to the plugins folder and the features folder under the Eclipse installation directory, create a link file if necessary, and reopen eclipse.
The third type: Online search installation. Eclipse→help→eclipse Marketplace ... → Enter the plugin to find in the search field → Click the install button → wait for installation → Restart eclipse as required
Here I recommend the first, if you do not know the installation address, then use the third, the second method sometimes operation error will appear problems, the risk is greater, so not recommended.
 
 
3. Tomcat
① Configuration
window→preferences→server→runtime environment→add→apache→ Select Tomcat version →next→ change display name (name) →browse ... Browse to select the pre-extracted Tomcat folder → Select jre→finish→ok→ open servers form → Right click Select new→server→ Select tomcat version → Select the tomcat→next→ selection item you just configured →finish
② Usage Experience
When we modify a code, start the Tomcat discovery page without changes, you must first turn off Tomcat, right-click the Tomcat server icon in the Servers window, select Clean ... To clean up the compiled source code, and then start Tomcat to recompile the source code.
and if you deploy multiple, or tomcat exceptions, right-click the Tomcat server icon in the Servers window, select Properties, check the right location of the General option, or click Switch location if it is not correct.
Although a Tomcat supports starting multiple projects at the same time, the project will be slow to start more, so if it is not required for the project, it is recommended that Tomcat deploy only one project to remove the temporarily useless items.
when the Web project starts to load too long to cause Tomcat to fail, you can extend the Tomcat startup timeout (default 45 seconds), double-click the Tomcat server in the Servers window to open the Tomcat Properties window, and click the Timeouts option in the upper right. Modifies the time of start (in seconds).
Eclipse By default is to call the Tomcat interface to impersonate the boot tomcat, rather than actually start Tomcat, so you often encounter a strange thing: after booting Tomcat, although it can be normal into the Web project home page, but not the Tomcat Kitten home page (that is, the HTTP ://www.2cto.com:8080/), and the files generated by the Web project deployment are not under the work directory in the Tomcat file directory. WORKAROUND: If the project is already deployed under the Tomcat server, remove it all first, right-click the Tomcat server icon in the Servers window, select Add and Remove ..., click the Remove All button, and click the Finish button. After cleaning, double-click the Tomcat server icon to open the Properties window, select the middle Server locations option on the left, select the Second radio button below (use Tomcat installation), and the Deploy Path text box Wtpwebapps "(default) to WebApps, which is the name of the folder where the project was published in Tomcat, it is best to redeploy the project to Tomcat, and after Tomcat is started, you can see the familiar kitten page, You can also see the familiar compiled page file under the work folder in the Tomcat file directory.
If the code appears to introduce javax.servlet.http.* error, the description is missing Tomcat jar package, introduced. Method: Right-click on the project in the left explorer, select Build path under Configure Build path ..., right click Add Library ... button, select Server Runtime and click Next to select Tomcat,finish.
 
 
4. Eclipse Common Configuration
Font Size
window→preferences→general→appearance→colors and fonts→ right window →basic options → Double-click Text Font
Modify the editing browser for open files
window→preferences→general→editors→file associations→ Select the file type you want to modify → select Edit Browser below
Show/Hide code line numbers
window→preferences→general→editors→ Check Show line numbers
Add a custom jar package libraries
window→preferences→java→build path→user libraries→ Right click on new ... → Enter name → Click Add JARs ... → Browse to select the appropriate jar file
configuring servers such as Tomcat
window→preferences→server→runtime Environment→add ... → Select the desired server (for Tomcat as an example, see Tomcat configuration above)
to modify a line break decision for a formatted code
Window→preferences→java→code style→formatter→ Right click on new ... → Enter name → Click ok→ in the Pop-up window select line wrapping tab → Modify the value of the Maixmum line width text box (default)
add XML syntax rules files such as DTD, XSD, and so on to implement automatic code prompting
window→preferences→xml→xml catalog→ Right click on add ... →key Type Select public id→location Browse to select the physical location of the DTD file you downloaded →key fill in the XML document header <! DOCTYPE the URL addresses that follow Sqlmapconfig public →ok
Modify the encoding format
Right-click the item/Package/class you want to modify → Select properties→ in the resource option to the right of the text file encoding select the encoding format you want
the same name (including class name, method name, variable name, and so on) is identified with a different background color
See:
 
or press the shortcut key: Alt + Shift + O
 
under the window→preferences there are many configurations, here is not possible to introduce a very full, so only list the most commonly used, we have time may be more into here to see, and then more points more try to understand.
 
 
5. SVN
uploading items to SVN server
Right-click the item you want to upload →team→share project ... →svn→ Create a new repository location/use an existing repository →next→ (enter a URL address) →next→ use the project name as the folder name →next→finish→ (enter username/password)
Note: When using the project name as the folder name, ensure that the SVN server side has created the same folder as the project name, otherwise the import fails. If the folder name created by the SVN side does not match the project name, select Use specified module name in this step to ensure that the SVN server side matches the project name.
download items from SVN server
Right-click →import in the Resource manager blank ... → Select svn folder → check out project from SVN → create new repository location/Use existing repository →next→ (enter URL address) →next→ as new project check out, and use New Project Wizard to configure →finish→yes→ configure new project (such as enter project name) →ok
Note: This "Input URL address" is different from the above upload item, this URL address needs to enter the specific folder of the project, and the previous because there is "use the project name as folder name" step, so do not need to bring the folder name.
submit, update, and restore files
Select the files you want to submit, jar packages, JavaBean, and so on, and then right-click →team→ to select the appropriate action.
 
reproduced for collection, Source: http://www.2cto.com/kf/201202/118313.html

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.