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.