Backend Development 7 min read

IntelliJ IDEA Tips: SVN Settings, Tomcat Encoding, Compilation Options, Code Templates, and More

This article provides a comprehensive collection of IntelliJ IDEA configuration tips covering SVN change visibility, opening projects in new windows, fixing Tomcat Chinese character encoding, adjusting import display, speeding up compilation, setting global file encodings, generating serialVersionUID, customizing code templates, and various other IDE shortcuts and settings.

Selected Java Interview Questions
Selected Java Interview Questions
Selected Java Interview Questions
IntelliJ IDEA Tips: SVN Settings, Tomcat Encoding, Compilation Options, Code Templates, and More

1. File modification change visibility

After modifying files in SVN, only the current file shows changes by default; to display parent directories with changed descendants, enable the setting:

File → settings → version control → 勾选show directories with changed descendants

2. Open multiple projects in new windows

3. Solve Tomcat Chinese character garbling

JAVA_TOOL_OPTIONS -Dfile.encoding=UTF-8

4. Multiple import methods cause file path to turn into asterisks

Adjust the settings:

Setting → editor → code style → java → imports

Increase the values for "Class count to..." and "Names count to...".

5. IDEA compilation is very slow

Modify the additional build process VM options:

File → Settings → Compiler → Additional build process VM options
-ea -Xms2048m -Xmx2048m

6. Uniform file encoding in IDEA

Global encoding settings:

File → Other Settings → Default Settings

Editor → File Encodings

Editor → File Encodings

7. UTF‑8 garbling in properties files

Enable "transparent native-to-ascii conversion" in:

file → setting → editor → file encodings

8. Fix Tomcat console garbling in IDEA

Menu: run → Edit Configurations (or the small arrow next to the run button)

Select the Tomcat configuration, then set VM option to UTF‑8:

-Dfile.encoding=UTF-8

9. Generate serialVersionUID with shortcut

After a class implements Serializable, press Alt+Enter to create serialVersionUID.

Navigate to:

setting → inspections → serialization issues → serializable class without ‘serialVersionUID’

10. Configure SVN

11. Configure Maven

12. Configure Tomcat container

13. Globally ignore a directory or file during compilation

14. Set unified compiler and language level

Recommended to use Javac compiler.

15. Set class comment template

/**
 * @Package ${PACKAGE_NAME}
 * @author 侯文远
 * @date ${DATE} ${TIME}
 * @version V1.0
 * @Copyright © 2016-2017 奥琦玮信息科技(北京)有限公司
 */

16. Set method comment template

Create a custom shortcut with the following content (do not start the first line with "*" if it already exists):

@author 侯文远
* @date $date $time

Steps:

Enter /**+enter above the method.

Fill in the relevant information.

At the end, type the custom shortcut, e.g., @aut+tab .

17. IDEA ignore specific files or folders (e.g., .idea, .iml)

18. Language Injection for regex or JSON validation

At a string assignment, press Alt+Enter and select "Inject Language or reference".

19. Add double or single quotes around selected content

Enable "Surround selection on typing quote or brace" in Settings → Editor → General → Smart Keys.

After enabling, select code and press the quote key (Shift+\") to wrap it with double quotes, or use other delimiters like <, {, [.

Source

blog.csdn.net/wytocsdn/ article/details/81913701

Backend Community Invitation

Join the backend technical community for programming developers, technical recruiters, and to share job referrals.

Maintain civil discussion focusing on technology exchange, job referrals, and industry topics.

Advertisements are prohibited; avoid private scams.

Contact to be added to the group.

JavamavenIntelliJ IDEATomcatSVNIDE settings
Selected Java Interview Questions
Written by

Selected Java Interview Questions

A professional Java tech channel sharing common knowledge to help developers fill gaps. Follow us!

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.