亲测好用的各种设置配置及原理

各种设置配置

本文如有借用其他博文观点的部分已做说明,其余均为个人总结。总结不易,转载请注明出处。

把Sublime Text 3 添加到右键菜单

基于https://my.oschina.net/adairs/blog/466777提供的方法一

亲测"用 SublimeText3 打开"可能会出现中文乱码的问题,建议改为"Edit with SublimeText3"

[Version]
Signature=""

[DefaultInstall]
AddReg=SublimeText3

[SublimeText3]
hkcr,"\shell\SublimeText3",,,"用 SublimeText3 打开"
hkcr,"
\shell\SublimeText3\command",,,"""%1%\sublime_text.exe"" ""%%1"" %%"
hkcr,"Directory\shell\SublimeText3",,,"Edit with SublimeText3"
hkcr,"
\shell\SublimeText3","Icon",0x20000,"%1%\sublime_text.exe, 0"
hkcr,"Directory\shell\SublimeText3\command",,,"""%1%\sublime_text.exe"" ""%%1"""

运行安装完可以打开 “win+R” 敲 “regedit”打开注册表,找到新加入的注册表,以便理解命令究竟做了什么。

亲测好用的各种设置配置及原理_第1张图片
sublimeText注册表.png

Maven安装 / 配置Maven环境变量

去官网http://maven.apache.org/download.cgi选择 Binary zip archive 下载并解压

然后设置环境变量:Path增加一项,maven的bin目录。

亲测好用的各种设置配置及原理_第2张图片
JAVA_HOME.png

#### 快速打开环境变量的方法:

win+R 敲 “sysdm.cpl” 打开系统属性,选“高级”

点确定后,win+R "cmd" 打开DOS,敲“mvn -version”看是否安装成功

The JAVA_HOME environment variable is not defined correctly报错

JAVA_HOME需设置为jdk的根目录,而不是bin目录,而且最后一定以 / 结尾(因为多了不要紧,少了则''%JAVA_HOME%bin'会出现问题),更改设置后要注意重新打开DOS再看版本才能看到变化。

设置本地Maven仓库

打开maven安装目录的conf/settings.xml,或者eclipse在用的,自己重写的settings.xml

找到标签(我的在第53行,不同版本可能不一样)将注释去掉, 把路径改为想要的

亲测好用的各种设置配置及原理_第3张图片
本地maven仓库.png

可以打开eclipse验证一下究竟设置好没有,注意User Settings 需为刚刚更改的那个文件。点Update Settings,Local Repository变为设置好的位置


亲测好用的各种设置配置及原理_第4张图片
eclipse设置Meven.png

此外eclipse的maven设置还有一处

亲测好用的各种设置配置及原理_第5张图片
eclipse设置Meven1.png

优化eclipse速度

参考:给Eclipse提速的7个技巧;Eclipse内存讲解,eclipse.ini设置;JVM(Java虚拟机)优化大全和案例实战;

eclipse.ini解析与优化

打开安装路径的eclipse.ini,下面结合两个官方文档解析一下我本地的eclipse.ini

# ini文件(可安装文件)设置规则:

命令中间有空格需要换行

值中间有空格需要用""包裹

-startup#用于启动的jar包
plugins/org.eclipse.equinox.launcher_1.4.0.v20161219-1356.jar
--launcher.library#可执行文件的共享库
C:/Users/Q/.p2/pool/plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.551.v20171108-1834
-product#
org.eclipse.epp.package.jee.product
-showsplash
org.eclipse.epp.package.common
--launcher.defaultAction
openFile
--launcher.appendVmargs#命令行参数将追加到本文件vm参数后,而不是覆盖
-vmargs#设置JVM参数,后面都是参数
-Dosgi.requiredJavaVersion=1.8
[email protected]/eclipse-workspace
-XX:+UseG1GC
-XX:+UseStringDeduplication
--add-modules=ALL-SYSTEM
-Dosgi.requiredJavaVersion=1.8
-Xms256m#设置最小最大堆内存
-Xmx1024m
--add-modules=ALL-SYSTEM
-Declipse.p2.max.threads=10
-Doomph.update.url=http://download.eclipse.org/oomph/updates/milestone/latest
-Doomph.redirection.index.redirection=index:/->http://git.eclipse.org/c/oomph/org.eclipse.oomph.git/plain/setups/

JVM属性,Oracle官方文档:https://www.oracle.com/technetwork/java/javase/tech/vmoptions-jsp-140102.html

Eclipse 运行参数官方文档:http://help.eclipse.org/kepler/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/misc/runtime-options.html

分析完我决定增加以下几个参数

-vm
E:/jdk1.8.0_91/

G1垃圾回收器的字符串去重

参考:Java Performance Tuning Guide by Mikhail Vorontsov

Java8u20版本(8 update 20) 中引入了字符串去重。一般来说,很多String对象是冗余的,存在许多 a != b 但 equals b 的情况,即引用不等但值相等。

最初JDK有一个String.intern()

eclipse窗口配置——关闭启动加载

  1. 预加载插件 Preferrnces > General > Startup and Shutdown

  2. 单词拼写检验 Preferrnces > General > Editors > Text Editors > spelling

  3. Maven更新策略 Preferrnces > Maven 取消 Download respository index updates on startup

  4. 语法校验 Preferrnces > validation

  5. 禁用主题 Window > Preferences > General > Appearance 取消 'Enable animations'

  6. 菜单管理 Window > Perspective > Customize Perspective

你可能感兴趣的:(亲测好用的各种设置配置及原理)