简体   繁体   中英

Colored source in java project in Eclipse

when I create a New Project in Eclipse, source files such as .html .xml are colored, but when I create New Java Project they aren't. How can I change this ? Thanks for help

You have to right-click on the .xml (or similar) file, choose "Open with" and select the right editor. If the editor is not listed in the menu, choose a new one with "Other..." option.

On the files that are missing the color coding right-click in either the project or package explorer with the mouse and check the open with entry on the context menu. It will show which editor is active for the file. I'm guessing it's the text editor - just select the correct editor for the file (for example, the XML editor) and you should see the coloring.

For mixed HTML and Java projects, I use Dynamic Web Project. You might have to download WTP if you do not use the Eclipse Java EE edition.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM