A summary of common issues with eclipse in Java development

Source: Internet
Author: User

1. Editor does not contain a main type

The package of this class is not added to the build path. Workaround: In the Package Explorer on the left, right-click the top-level directory--build Path--use as source folder for this class. This will solve the problem. Reopen class, run again, OK. 2. Change the Eclipse code editing area font sizeWhen using Eclipse CDT under Ubuntu 10.04, the background color of the Code-hover window (the Code preview window that pops up when the mouse moves to the code element) is shown in black by the system default scheme. This will directly cause the black code text to not be seen (although it can be read with a high amount of mouse frame selection). The configuration options for modifying this color are located in: Menu bar window->preferences->c/c++->editor project appearance color options inside the source hover Background option, uncheck System Default and choose the color you like 3. Eclipse Shortcut keysCtrl+m maximizes the current window ctrl+/comments on the current row or selected rows, and if those lines are already commented, press this key combination to cancel the comment ctrl+f11 run the last bootctrl+shift+fAutomatic typesettingctrl+shift+o automatically adds missing packages to the file header in the program   4. Find the specified string in the current project file(1) ctrl+h Open the Search interface(2) Select File Search (3) in the Containing text box, enter the keyword, case sensitive, Regular expresssion (Regular Expression) (4) in the file name Patterns box Select the file type, if you do not know, you can input *. * (5) Select a search scope in scope   5. Use Eclipse to run programs that require input parameters rather than cmd(1) Select the small triangle behind run of the Eclipse toolbar and click Run Configurations (2) to select X=arguments (3) in the program Arguments input parameters, multiple parameters separated by a space   6. Change the font and size above JLabel and JButtonJbutton2.setfont (New Java.awt.Font ("Dialog", 1, 15));
"Dialog" represents the font, 1 for the style (1 is bold, 0 is normal) 15 is the font size
JLabel same 7. Find out if a string appears in eclipse for the entire wokespaceIf you use Ctrl+f directly, you can only search the current document, if you want to search for the whole item, CTRL+H, the top right corner of the popup dialog has a left-to-bottom option, general selection FileSearch 8. After eclipse opens the file, Chinese garbledThis is because the default character encoding for Eclipse is GBK, which is set to encoding in the Text file UTF-8, general-> Workspace, window, Preferences. 9. Set the memory size of the eclipse JVMBy default, the default memory for the JVM is-xmx256m, and when Eclipse reports an error Java.lang.OutOfMemory:Java heap space when it runs the program, it should modify the JVM's memory size by: Window- > preferences-> Java-installedjres, select a JRE and click Edit to reset the JVM memory size, such as-xmx1024m third-party jars in Java are not put into referenced librariesThere are two types of view in Eclipse, Project Explorer and package Explorer. Referenced Libraries appears in the Packageexplorer window, but the default left side of the Java EE perspective is only the Projectexplorer window. So just open the Package Explorer window, open the method: Menu Window->showview->other->java->package Explorer, If the referenced libraries directory is still missing from the Packageexplorer window, you can click the inverted triangle arrow in the upper-right corner of the Packageexplorer window and select "Show" from the pop-up menu referenced Libraries ' Node.

A summary of common issues with eclipse in Java development

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.