1. Intro

  • 以Eclipse 2409版本为例

2. Lombok

  • -javaagent:lombok.jar

3. Plugin

  • D:\Install\Dev\eclipse\dropins\pydev.link

  • path=D:/Install/Dev/eclipse/Custom/PyDev

4. Upgrade

  • Window ☞ Preference ☞ Install/Update ☞ Available Software Site

  • Add ☞ Eclipse2406:https://download.eclipse.org/releases/2024-06/

  • Ok ☞ Help ☞ Check for Update ☞ Restart Eclipse

5. Main

${:import(
	java.lang.invoke.MethodHandles,
	org.springframework.boot.SpringApplication
)}
public static void main(String[] sa) {
	Class<?> cls = MethodHandles.lookup().lookupClass();
	SpringApplication.run(cls, sa);
}

6. Logger

${:import(
	org.slf4j.Logger, org.slf4j.LoggerFactory,
	java.lang.invoke.MethodHandles
)}
private static final Logger logger = LoggerFactory
	.getLogger(MethodHandles.lookup().lookupClass());
${cursor}

7. try_with_resource

try(${cursor}){

}catch(${IOException} ${exception_variable_name}){

}

8. Graphviz Path

  • D:\Install\System\Graphviz\bin\dot.exe

10. Source Block

${cursor}

11. Table

[%autowidth,options="header",cols="${cursor}"]
|===

|===

12. Type

/**
 * Copyright 2022 - ? Elf All Rights Reserved
 * @description
 * @create ${d:date('yyyy-MM-dd HH:mm:ss')}
 * @author elf
 * @version 1.0.0
 */

13. Method

/**
 * @title ${enclosing_method}
 * ${tags}
 * @return ${return_type}
 * @create ${d:date('yyyy-MM-dd HH:mm:ss')}
 * @author elf
 * @since 1.0.0
 */

14. Gradle

  • Local Location:D:\Install\Dev\Gradle

  • User Home:D:\Install\Space\Gradle

  • Java Home:D:\Install\Dev\Java\Graal21

15. SilentExitException

  • Window ⇒ Preferences ⇒ Java ⇒ Debug

  • 取消suspend execution on uncaught exceptions

16. 路径

  • D:\Install\Dev\eclipse

  • D:\Install\Dev\workspace

17. 插件

17.1. 卸载插件

  • TM Terminal

  • Mylyn WikiText Editor

  • Tip of the Day UI Feature

  • Wild Web Developer XML Tool

  • POM Editor using LemMinX language server

  • m2e - slf4j over logback logging (Optional)

17.2. 重要插件

  • SQL Editor

  • Bash Editor

  • Batch Editor

  • HiJSON Editor

  • Spring Tools 4

  • Jenkins Editor

  • Asciidoctor Editor

  • Eclipse Docker Tooling

  • Kubernetes Manifest Editor

  • JustJ OpenJDK Hotspot JRE Complete

17.3. 可选插件

  • efxclipse

  • MyBatipse

  • JBoss Tools

  • Yaml Editor

  • Eclipse PDE

  • CMake Editor

  • cmake4eclipse

  • EGradle Editor

  • GoClipse

  • Eclipse Golang Development Tooling

  • Autodetect Encoding

  • ResourceBundle Editor

  • Cucumber Eclipse Plugin

  • Eclipse Web Developer Tools

  • Lombok:-javaagent:lombok.jar

  • Eclipse Enterprise Java and Web Developer Tools

  • ANSI Console: spring.output.ansi.enabled: always

17.5. Jdk替换

  • 高版本Eclipse内置JustJ OpenJDK Hotspot JRE Complete,
    故请慎重卸载或增删此插件及其相关Jdk插件,否则可能无法编译.

  • eclipse.ini中 --launcher.appendVmargs-vmargs 参数中添加
    -vm \r\n D:/Install/Dev/Java/Jdk1705/bin

  • 注释artifacts.xml中openjdk节点

  • 删除plugins/openjdk中内置Jre

18. 常用设置

  • Window → Preferences →

18.1. General

18.1.1. Appearance

  • Colors And Fonts → Basic → Text Font → 12

18.1.2. Content Types

UTF-8

18.1.3. Editors

  • File Associations → Text Editors
    → Spelling → Disable Spell Checking

18.1.4. Keys

  • Content Assist → Alt + / → Editing Text

  • add suffix or in favor of .gitignore

18.1.6. Workspace

  • text file encoding → UTF-8

18.2. Asciidoctor Editor

  • Use Installed asciidoctor instead ASP

  • Path to Asciidoctor
    E:\Install\Dev\Ruby27X64\bin

  • Path to Java binary,用于plantuml
    E:\Install\Dev\Java\Jdk\bin\java.exe

18.3. Gradle

  • Local Installation Directory

    • E:\Install\Dev\Gradle

  • Gradle User Home

    • E:\Install\Dev\Repo\GradleUserHome

  • Java Home

    • E:\Install\Dev\Java\Jdk1501

18.4. Java

18.4.1. Code Style

  • Code Templates → Comments → Type and Method

/**
 * Copyright 2020 - ? Elf All Rights Reserved
 * @description
 * @create ${d:date('yyyy-MM-dd HH:mm:ss')}
 * @author elf
 * @version 1.0.0
 */

18.5. Jsp Templates

w[source,java]

<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width,initial-scale=1.0">
	</head>
	<body>
		${cursor}
	</body>
</html>

18.6. PlantUml

  • Graphviz Path

    • E:\Install\Install\GraphvizV2441X32\bin\dot.exe

18.7. Font Size

  • Explorer(Package/Project/Navigator)

  • plugins/org.eclipse.ui.themes_1.2.400.v20190223-1254/css

  • 打开e4_basestyle.css(或修改具体的主题均可),末尾添加样式

  • 重启eclipse

CTabFolder Tree {
	font-size: 13px;
}

19. Speed Up Eclipse

19.1. Excessive Index and History

WORKSPACE_PATH/.metadata/.plugins/org.eclipse.jdt.core
WORKSPACE_PATH/.metadata/.plugins/org.eclipse.core.resources/.history

D:\Dev\workspace\.metadata\.plugins\org.eclipse.jdt.core
D:\Dev\workspace\.metadata\.plugins\org.eclipse.core.resources\.history

19.2. Class Verification Overhead

-Xverify:none

19.3. Insufficient Memory Allocation

-server
-XX:PermSize=256m
-XX:MaxPermSize=256m
-XX:+UseParallelGC
-Xms512m
-Xmx1024m

19.4. eclipse.ini Default Setting

-XX:+UseG1GC
-XX:+UseStringDeduplication
-Xms256m
-Xmx1024m

20. Plugin Directory

  • E:\Install\Dev\workspace\.metadata\.plugins

    • org.eclipse.jdt.core

    • org.eclipse.core.resources\.history

    • org.eclipse.ltk.core.refactoring\.refactorings

    • org.eclipse.debug.core\.launches

    • org.eclipse.m2e.core

    • org.eclipse.m2e.jdt

21. Classpath For src/test

<classpathentry kind="src" output="target/classes" path="src/main/java">
  <attributes>
    <attribute name="optional" value="true"/>
    <attribute name="maven.pomderived" value="true"/>
  </attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
  <attributes>
    <attribute name="maven.pomderived" value="true"/>
  </attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
  <attributes>
    <attribute name="optional" value="true"/>
    <attribute name="maven.pomderived" value="true"/>
    <attribute name="test" value="true"/>
  </attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
  <attributes>
    <attribute name="maven.pomderived" value="true"/>
    <attribute name="test" value="true"/>
  </attributes>
</classpathentry>