JDK环境变量的配置
- 新建JAVA_HOME指向JDK的根目录
- 为环境变量path添加新值
(Path:windows从左向右读取,linux从右向左读取环境变量值。)
%JAVA_HOME%\bin
%JAVA_HOME%\jre\bin
java -version
- 定义classpath
.;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar;
dt.jar 关于运行环境(主要是swing包)
tools.jar 工具类库(编译和运行等)
Eclipse的配置
Windows->Preferences:
Workspace: Other UTF-8
Startup and Shutdown: 去掉不需要的
Editors: show multiple editor tabs
Text Editors: Insert spaces for tabs
show line numbersspelling: 去掉Enable spell checking
Installed JREs: 改成自己的VM
Compiler: Compiler compliance level: [1.8]
Colors and Fonts: Text Font-> Edit…设置字体大小,推荐字体:Consolas,或者YaHei Consolas Hybrid
Java->Code Style->Formatter: Edit… 更改Profile name: Eclipse[beeworkshop]
Off/On Tags
Enable Off/On TagsJava-> Editor -> Content Assist
Auto Activation 修改触发选项Java-> Editor -> Save Actions
Format source code
Format all lines安装插件ANSI Escape in Console
Ansi Console : Enable, Use Windows color mapping, xterm安装插件Darkest Dark Theme with DevStyle(可选)
安装STS(Spring Tolls4 for Spring Boot, Spring Tool Suite 4)
安装WindowBuilder(用于Swing GUI界面可视化设计)
Help->Eclipse Marketplace…->查找WindowBuilder
然后
新建>其它
找到WindowBuilder
打开Swing Designer
选择JFrame
点击下一步优化xml validating
顶层配置项Validation中,关注列表The selected validators will run …
将Build列复选框取消如下内容:
DTD Validator,XML Schema Validator,XML Validator。
文本编辑区背景设置
菜单Window --> Preferences:
General ----> Editors ----> Text Editors:
Appearance color options:
- Current line highlight ----> Color (可以 R:189,G:222,B:255)
- Background color ----> Color 取消System Default (可以 R:184,G:205,B:142)
代码提示
菜单定位:Windows->preferences->Java->Editor->Content Assist。然后将Auto activation triggers for Java中的内容替换成
abcdefghijklmnopqrstuvwxyzABCDEFGHIGKLMNOPQRSTUVWXYZ.
最后有一个点。
菜单定位:windows->preferences->XML->XML Files->Editor->Content Assist。然后将Prompt when these characters are inserted中的内容替换为
<=:abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
最后有一个空格。
Eclipse自动生成返回值类型及赋值变量的快捷键
Ctrl + 2 + L