Java project export source code jar package check Chinese comments garbled in Eclipse, jareclipse
Problem scene:
Since many projects are added to the Maven main project, it is convenient to update and debug the project, but the speed of Eclipse is severely affected. Therefore, some projects are exported to jar Packages containing source code separately, uploaded to nexus for reference by other projects. However, Chinese comments are garbled during Eclipse viewing in referenced projects.
In fact, this is a problem caused by the default encoding of eclipse.
Solution: 1. Modify the default encoding of text files in Eclipse:
Windows-> Preferences-> general-> Workspace-> Text file encoding settings to UTF-8
2. Modify the default encoding of the JAVA source file:
Windows-> Preferences-> general-> Content Types-> Context Types tree on the right, click Text, select Java Source File, enter the UTF-8 in the Default encoding input box below, and click Update
3. Re-export the source code jar package and upload it to Nexus; 4. Execute Maven Update for the referenced project;
Note: If the version is not updated, you must first Delete the corresponding Jar package from the local database and then execute Maven Update.