Two minor questions about UltraEdit: ultraedit

Source: Internet
Author: User
Tags ultraedit

Two minor questions about UltraEdit: ultraedit

Question 1: How to color keywords in Java coding?

First, you must change the suffix of the edited file name to. java;

Find the wordfilefolder under the installation directory of ultraedit(the former is a wordfile.txt document );

Finally, open the UltraEdit page --> toolbar-advanced --> Configuration --> editor display --> syntax coloring --> complete path of the word list --> select the path found in the previous step --> OK --> restart UltraEdit.

 

Problem 2: When Using UltraEdit to edit text, the following error occurs: (copied from Baidu)

[Javac] HelloWorld. java: 1: class, interface, or enum
[Javac] ackage com. csdn. demo;
[Javac] ^
[Javac] 1 error

Let's talk about the solution to this problem first.

Open the UltraEdit page --> toolbar-advanced --> Configuration --> editor --> New File Creation --> encoding type --> select "create new file to ANSI" --> Create a new file. java file, copy the original code to compile it.

The main cause of this error is the java file encoding.

In the Chinese operating system, the consistent "javac HelloWorld. UTF-8 (with BOM) encoding. java source file. If no encoding parameter (encoding) is specified, GBK encoding is used by default. When the compiler uses GBK encoding to compile a UTF-8 file, it will take the UTF-8 (with BOM) encoding File Header of three bytes of header information, the two Chinese characters in GBK are decoded into garbled Characters Based on the character that occupies two bytes and English occupies one byte. This source file should be saved in another notepad for UTF-8 encoding.

For the correct source file of non-GBK and its subset encoding (GB2312), the compilation method is "javac-encoding" UTF-8 "HelloWord. java ", so that no garbled Chinese characters will appear in the specified code error.
But there will still be an error, prompting "HelloWorld. java: 1: Invalid character: \ 65279.
This is because. java only recognizes UTF-8 (without BOM) for UTF-8 encoding. While notepad only supports saving the file as a signed UTF-8, is there a way to solve it?
Of course, there are some tools, such as EmEditor, EditPlus, UltraEdit, and Notepad ++, to save them as UTF (without BOM) (different from the encoding file with UTF + BOM. At this time using the "javac-encoding" UTF-8 "HelloWorld. java", there is no problem with the above encoding.

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.