Eclipse 的常用插件.

Eclipse 的常用配置.

以免重装Eclipse后忘记配置.

一.Eclipse常用插件

  • 注意: 点击 Help 中的 Eclipse Marketplace 即可打开 Eclipse 插件应用市场.
  • 使用 Eclipse Marketplace 安装插件较慢, 需要连接外网.

1.Spring Tools插件

  Spring开发的支持插件, 在搜索框搜索 Spring Tools 安装第一个即可. 不支持的话, 安装下一个.

eclipse_010

2.DevStyle

  DevStyle 插件可以修改 Eclipse 的主题, 可以改为 暗黑模式.

在搜索框搜索 DevStyle 安装第一个即可.

eclipse_014

3.Eclipse Class Decompiler

  Eclipse Class Decompiler, Java反编译插件.

在搜索框搜索 Eclipse Class Decompiler 安装第一个即可.

eclipse_015

  • 在想要查看的 class 文件上右键单击, 然后依次选择: Open With→Class Decompiler Viewer 即可查看.

eclipse_016

4.SVN插件

  在旧版的 Eclipse 中都集成了 SVN 插件, 不清楚哪个版本开始, Eclipse不再集成 SVN 插件, 需要的人要自己安装.

  在搜索框搜索 Subversive 安装第一个即可. 当然, 也可以使用 Subclipse 插件.

eclipse_011

  • ①注意: 安装时选择下述安装即可.

eclipse_012

  • ②等待安装结束并重启 Eclipse 后. 打开 Preferences 的 Version Control(Team)→SVN.
  • ③找到 SVN Connector, 你点一下 SVN Connector, 它会提示你缺少 Connector, 然后你安装所有的 SVN Connector 等待重启即可.

eclipse_013

5.QuickImage

  可以更方便的在 Eclipse 中查看图片.

  在搜索框搜索 QuickImage 安装第一个即可.

打开图片时, 需要右键单击图片依次选择: Open With→QuickImage 打开查看即可.

eclipse_017

6.Autodetect Encoding

  支持在 Eclipse 的右下角显示当前文件的编码格式和换行符格式. 当然, 支持在 编码 或 换行格式 上右键单击进行切换.

  需要注意的是, 若是切换 文件的编码格式, 可能会导致部分文字的乱码(变为???).

eclipse_018

7.批量编码转换插件

  支持多种编码之间的互转, 当切换操作系统时, 可以很方便的转换项目的编码.

  • ①从GitHub下载jar包, https://github.com/jiangxincode/com.lifesting.tool.encoding/releases
  • ②将下载的jar放到你的 Eclipse 软件的 plugins 目录下.
  • ③选择你要转换的项目, 右键单击后, 点击 properties, 再点击 Convert Setting, 之后添加转换规则.
  • ④选择你要转换的项目, 在项目的 src 目录上右键单击, 再点击 Lifesting ToolsSet Encoding.

二.Eclipse常用Preferences

1.添加JDK环境

  依次找到 Java→Installed JREs, Add 你安装的JDK即可.

  • ①选择 Standard VM

eclipse_004

  • ②选择你的 JDK 安装路径, Finish 即可.

eclipse_005

  • ③当你有多个 JRE 环境时, 你可以切换 Eclipse 默认的 JDK 版本. 切换后保存应用即可.

eclipse_006

  • ④如果你切换了Workspace默认的JDK版本, 你需要修改 JDK 编译 level:

eclipse_007


2.修改编码为UTF-8

①Content Types

  依次找到 General → Content Types 中的 Text. 将其中的:

  • Java Properties File
  • JSP

等的 Default encoding 修改为 UTF-8.

eclipse_001

②Spelling

  依次找到 General →Editors→Text Editors →Spelling, 修改编码格式为 UTF-8 即可.

在这里还可以使用用户自定义的字典, 用于 Eclipse 检查英文单词(变量)的拼写.

eclipse_002

③Workspace

  依次找到 General→Workspace, 修改工作空间的默认编码为 UTF-8 , 修改换行符样式为 Unix 即可.

eclipse_003

④SQL

  依次找到 Data Management→SQL Development, 将其中的:

  • Execution Plan View Options
  • SQL Results View Options→Export Format Options

中的编码格式均改为 UTF-8 .

⑤Web

  依次找到 Web 中的:

  • CSS Files
  • HTML Files
  • JSP Files

将其中的 Encoding 改为 UTF-8 保存应用即可.

eclipse_008

⑥XML

  依次找到 XML→XML Files, 将其中的 Encoding 改为 UTF-8 保存应用即可.

eclipse_009


3.Maven配置

  • ①下载最新的maven, Maven官网.
  • ②修改Maven的conf目录的 settings.xml 配置文件:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<!--可以修改localRepository节点的值切换Maven本地仓库路径-->
<localRepository>/path/to/local/repo</localRepository>

<!--①在 mirrors 节点添加下载镜像地址-->
<mirror>
<id>aliyunmaven</id>
<mirrorOf>*</mirrorOf>
<name>阿里云公共仓库</name>
<url>https://maven.aliyun.com/repository/public</url>
</mirror>

<!--②在 profile 节点添加如下内容-->
<profile>
<id>jdk-1.8</id>
<activation>
<activeByDefault>true</activeByDefault>
<jdk>1.8</jdk>
</activation>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion>
</properties>
</profile>
<!--上述配置可以使得用Maven构建的项目使用JDK1.8-->
  • ③在 Eclipse 中, 依次点击 Preferences→Maven→Installations, 添加你的 Maven:

eclipse_019

  • ④在 Eclipse 中, 依次点击 Preferences→Maven→User Settings, 将配置文件修改为你在②中修改的 settings.xml

eclipse_020

4.高级内容提示

  依次点击 Preferences→Java→Editor→Content Assist, 如下图所示, 填上所有的字母后, 点击保存应用即可.

eclipse_021

5.Server

  依次点击 Preferences→Server→Runtime Environments, 如下图所示, 再点击 Add 后, 选择你的 Server 版本, 之后选择你的 Server 路径, 之后点击 Finish 保存应用即可.

eclipse_022

eclipse_023

eclipse_024


评论