MyEclipse个性设置

MyEclipse个性设置


(1)Myeclipse 打开 jsp 的默认编辑器不好,会同时打开预览。所以做如下更改

Windows–>Perferences–>General–>Editors->File Associations
把默认改成 MyEclipse JSP Editor。

(2)关闭quick update 解决MyEclipse 启动时自动更新卡住的问题
MyEclipse --> Preferences -->Genernal-->Network Connections
把选项 改为手动的,manual。

因为有例子使用了Groovy,需要install groovy plugin,但原先的8.5M2得一起升级到8.6.1,几百兆,太可怕了,装个全新的
MyEclipse 8.6.1吧。(放弃Groovy,全白费了!)

一,彻底删除MyEclipse
    (1)删除安装目录
    (2)删除 ~/.myeclipse,~代表home目录。~/.myeclipse.properties可以留着,是licence
    (3)cmd regedit Ctrl+F 删除所有myeclipse项
    (4)重装后选择新的workspace,再把原先的工程一个个引进来

二,注册码(记得注册时候断开网络)
    name:myeclipse8.5
    code:zLR8ZC-855550-68567156703100078    

三,MyEclipse解决JSP乱码(选择UTF-8为文件在任何OS中的实际编码格式)
    (1) Window->Perference->General->Content Type 右框中的全部设为UTF-8。边改边Update,否则没有生效。
    (2) Window->Perference->General->Workspace,看到Text file encoding,点击Other,选择UTF-8;看到New text file liine delimiter,点击Other,选择Windows。
    (3) Window->Perference->MyEclipse->Files and Editors子列表中的编码全部设为UTF-8。    
    (4) 右击项目,选择Properties,点击Resource,看到Text file encoding,点击Other,选择UTF-8;看到New text file line delimiter,点击Other,选择Windows。
    (5)安装目录下myeclipse.ini中加入
            -Dfile.encoding=UTF-8
            注意:至少在Windows下不要加,不然Console会乱码,Fuck! 
            从Jboss的boot.log中可以看到这么一行:DEBUG [ServerInfo]     file.encoding: GBK。
            这表示JBoss日志是以GBK编码的,而现在已经把所有能设置的编码方式全部设置为UTF-8了,必然冲突,于是Console乱码。
            JBoss也不知道在哪里改日志编码方式,想改成UTF-8也不行。
            Console估计类似于cmd,会根据系统情况自动适应编码,所以就不要改了。
    (6)
    <%@ page language="java" import="java.util.*" pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
    <%@ taglib prefix="x" uri="http://java.sun.com/jsp/jstl/xml"%>
    <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
    <fmt:requestEncoding value="UTF-8" />
    (7)
     <meta http-equiv="content-type" content="text/html; charset=UTF-8" />   
     
     经过上述步骤,新建java文件即为UTF-8编码,Eclipse编译、运行、调试都没问题,但是做RCP应用的Product输出时、或者插件输出时,则总是出错,要么不能编译通过(输出时要重新compile)、要么输出的插件运行时中文显示乱码。此时需要再RCP应用、或插件Plugin工程的build.properties中增加一行,javacDefaultEncoding.. = UTF-8。让输出时编译知道java源文件时UTF-8编码。这个设置需要保证所有的java源文件时UTF-8编码格式,如果不全是,可以参考 Eclipse帮中(Plug-in Development Environment Guide > Reference > Feature and Plug-in Build configuration),建议全部java源文件是UTF-8编码。
     
     如果文件已经无法以正常编码导入Eclipse,可用Firefox打开文件,选择可以识别的编码方式之后,把代码复制过来。
     
四,将messagesource.propertis本地化
    native2ascii messagesource.propertis messagesource_zh_CN.propertis
    运行,发现页面上从资源文件中读取的内容仍然为乱码。
    解决方法:本地化时指定编码方式即可,如下:
    native2ascii -encoding UTF-8 messagesource.propertis messagesource_zh_CN.propertis

五,Eclipse 中更改 jdk 版本
    Window-->Preferences-->Java-->Installed JREs, 然后添加jdk的路径D:\Program Files\Java\jdk1.6.0_20,再打上勾;  
    也可以更改单个项目的 jdk 版本:
    右击项目-->Properties-->Java Builder Path-->Libraries-->添加库-->JRE系统库-->下一步;
    备用JRE 换一个即可

六,自动完成
    Window-->Preferences-->java-->Editor-->Content Assist “Auto-Activation”下面的“Auto Activation triggers for java”除了.还可以填其它字符,表示在出现这些字符时会出现自动提示。
    Ctrl+/:注释当前一行
    Ctrl+Alt+/:依当前环境自动补齐

七,修改MyEclipse安装目录的eclipse.ini文件,加大JVM的非堆内存 
    Xmx的设置在eclipse.ini文件中。如果该值设置太大,而电脑内存中没有连续的这么大内存空间的话,Eclipse就会启动出错。所以解决办法是改动eclipse.ini文件,删除Xmx的设置,这样Eclipse就可以正常启动。也可以更改为合适的值,如下:
    
    -clean
    -showsplash
    com.genuitec.myeclipse.product.ide
    --launcher.XXMaxPermSize
    256m
    -vmargs
    -Xms128m
    -Xmx512m
    -Duser.language=en
    -XX:PermSize=448M
    -XX:MaxPermSize=448M
    -Dfile.encoding=UTF-8
    
    把下面的那个 -XX:MaxPermSize 调大为512M,再把 -XX:PermSize 调成跟 -XX:MaxPermSize一样大 

八,字体和拼写检查
    General-->Appearance-->Colors and Fonts 中的 Basic Text-->Editor Block Selection Font和Text Font;Java-->Java Editor Text Font和Properties File Editor Text Font;Structured Text Editor Text Font 字体设为Bitstream vera sans mono 11号
    
    Eclipse 的单词拼写检查有点弱智,有时非常烦,禁掉它。 General --> Editors --> Text Editors --> Spelling 去掉 Enable spell checking 前面的勾。

九,MyEclipse禁用更新启动设置
    1. Window --> Preferences --> General --> Startup and Shutdown -->找到"Automatic Updates Scheduler " 项去掉前面的勾。顺便把不需要的MyEclipse EASIE 那些个j2ee容器也都取消掉,只保留Tomcat,JBoss,Weblogic。但不要乱去啊,会启动不起来的。
    
    Pulse Collaboration Control Center 也取消掉
    
    请问如何删除myeclipse中的derby?
    在Windows-->General-->Startup and Shutdown里,这里面是启动时候加载的插件,你把里面一个叫derby的钩去掉就行了,其他的也可以去,看名字都知道了,很多的数据库,服务器支持,很多我们一般都不用,这也是优化MyEclipse的一个方法。你应该知道Eclipse就是个容器,他是靠插件扩展功能的,MyEclipse其实就是他的一个大的插件。
 
    2. Window --> Preferences --> Myeclipse --> Maven4Myeclipse --> Maven --> "Download repository index updates on startup" 去掉前面的勾。 顺便把Maven JDK 换成前面更改的jdk1.6.0_20。
    
    关闭自动更新(版本变化没找到)  
    Windows > Preferences > MyEclipse Enterprise Workbench > Community Essentials, 把选项 "Search for new features on startup"的前勾去掉即可.

    (版本变化没找到)  
    In ME 7.1, to disable updates on startup, you have to disable the Dashboard from showing up on startup.

    去掉MyEclipse繁杂的自带插件自动加载项(版本变化没找到)  
    Window > Perferences > General > Startup and Shutdown > 将Plug-ins activated on startup 中的复选框有选择性的勾选去掉。
 
十,发布工程时不发布External jar(因为服务器中有,当前工程只是引入这些jar,使编译通过) 
    Java EE APIs should never be provided by an archive when deploying to a compliant app server. If you were moving from Tomcat to JBoss AS it's important to keep that in mind. Aha, as I thought you are bundling in the war all sorts of stuff which AS6 provides (and doesn't support overriding simply by placing in the war).

    In general until AS7 I would recommend not duplicating libs in your war that in the AS, it will cause you a lot less problems in the long run :-D

    在Window-> Preference-> MyEclipse-> Java Enterprise Project-> Web Project-> Deployment取消选中Jars from the Build-path


十一,MyEclipse8.0 安装插件(没有试过) 
    下载插件解压后直接放在Myeclipse8.0下面的dropins目录就行了,然后在myeclipse的configuration目录里面删除org.eclipse.update这个目录,myeclipse会自动加载这个插件。这里就安装subclipse SVN插件举例,说明一个插件的安装。如果用的是link文件方法,则可以与MyEclipse自带插件分开管理:
    (1)先把你下载的插件.zip文件解压到你要放的目标目录(如:d:\MyPlugin),解压后,在d:\MyPlugin目录下,有plugins等目录。
    (2)在MyEclipse 8的dropins目录下建立一个.link文件(如:subclipse.link)。文件内容如下:
          path=d:\\MyPlugin
    (3)重新启动MyEclipse,即可。
    那么,安装多个插件,就可以照此处理,在subclipse.link中增加新的一行,或者新建.link文件。要删除插件,只要删除对应的.link文件,或者.link文件中对应的某行。
 
十二,关闭MyEclipse的自动validation (没有试过) 
    默认情况下MyEclipse在启动的时候会自动验证每个项目的配置文件,这是一个非常耗时的过程。
    Windows-->Perferences-->MyEclipse-->Validation 
    除了Manual 下面的全部点掉,Build下只留 Classpath Dependency Validator只保留 Manual 项就可以了(Manual全部勾选,Bulid项只留下第一项)。如果需要验证的时候只需要选中文件,然后右键选择 MyEclipse - Run Validation就可以了。

十三,修改MyEclipse编辑JSP页面时的编辑工具  (没有试过) 
    Window > perferences > General > Editors > File Associations >在File types 中选择 *.jsp > 在Associated editors 中将"MyEclipse JSP Editor"设置为默认。
 
十四,查看Eclipse对应版本
    D:/Program Files/Genuitec/MyEclipse-8.6/readme/readme_eclipse.html显示如下
        Release 3.5.2
        Last revised February 10, 2010
        
十五,安装Groovy插件
    (1)Go to "Help | MyEclipse Configuration Center " in the main menu 
    
    (2)Switch to Software and press "Add Site" button 
    
    (3)Enter the following URL as the location: http://dist.springsource.org/milestone/GRECLIPSE/e3.5
    
        Important: Eclipse update manager needs internet access. If your computer sits behind a proxy server, you will need to configure Eclipse accordingly: go to Window -> Preferences, then General -> Network Connections and enter the host name or IP and port of your proxy server. 还要选Manual,对应的所有单选勾上按钮填上才有效。Fuck!
    
        If there is no internet access, use the bundled update site archive:
        <Profiler Installation Directory>/lib/eclipse-plugin/xxx_eclipse.zip 
    
    (5)In pop-up, press "Add to Profile..." 注意,这里是右键选择目录树下的最小子项
    
    (6)Then press "Apply 1 change..." Accept the license and press "Next". Restart MyEclipse as suggested
    
    These zip files are the compressed version of the update site. They are not plugins that you can just drop into your eclipse installation. Here's how to install an archive:
    
        Download the snapshot locally
        Do not unzip or move into your dropins directory
        Start eclipse
        Help -> Install new software -> Add...
        Select the location of the zip you just downloaded
        Install as you would from the regular update site
        
十三,代理设置
    由于myeclipse禁用来来自中国的IP,所以必须要用外国的出国代理才能以网络方式更新,否则,试两次似乎能够更新成功,实际上却使得Eclipse的许多功能不见了,无法解释。以"6.25 出国 http 代理"搜索到代理后,配置到MyEclipse。多试几次Software and Workspace Center,一定要确保网络通畅之后,再安装插件。一旦出现 'Updating MyEclipse 8.6: An error was detected while performing the engine operation',下载失败,无法安装不说,Eclipse的许多功能perspective也不见了。还会有'Unable to retive osgi.bundle, com.lowagie.itext, 1.5.4.v20090305'之类的警告,而且你也不知道如何重新安装,反正很多perspective功能已经找不到了。除了完全重装MyEclipse,好像也没办法了,因为jsp文件它都已经不认了。


    Using the -clean command line argument when starting up Eclipse can help a lot of strange problems disappear that can be related to stale plugin cache information. The way it is used is as an argument to the Eclipse executable, on Windows that is eclipse.exe:
    Code:
    
    eclipse.exe -clean
    
    Additionally with Eclipse 3.1 there is a new eclipse.ini file that you can include -clean in on it's own line near the top of the file. This command tells Eclipse to erase and rebuild it's plugin cache to avoid conflicts with incorrect plugin information. This is very important to use when upgrading between major releases or trying to fix a strange behavior in your workspace. After you have used -clean once, you are free to remove it from your command line arguments.
    
    With later releases of MyEclipse, the method of specifying -clean has changed slightly from the above instructions.
    
    For installations performed with one of the MyEclipse installers, or with Pulse, the executable will be myeclipse.exe (on Windows systems) or myeclipse (on Linux systems).
    
    The ini file to change would be myeclipse.ini.
        
十五,删除MyEclipse自带的Java EE 5 Libraries,引入JBoss的jar
    右键单击Java EE 5 Libraries,Build Path-->Remove from Build Path。当然了,需要引入如下几个jar,它们都可以在JBoss 6.0 Final安装目录中找到。
    jboss-ejb-api_3.1_spec.jar
    jboss-servlet-api_3.0_spec.jar
    jboss-jsp-api_2.2_spec.jar
    jboss-el-api_2.2_spec.jar    
    jsf-api-2.0.3-b05.jar
    jsf-impl-2.0.3-b05.jar
    jstl.jar
    
十六,在现有项目中引入Groovy支持
    右键单击所在项目,Configure-->Convert to Groovy Projects,Referenced Libraries下面会出现 Groovy Libraries,OK!
    
    @Override注解在jdk1.5环境下只能用于父类的方法,但不能用于接口的方法。也就是在1.5下要使用@Override 这个annotation 必须保证被标注的方法来源于class 而不是interface 。查看MyEclipse的jdk配置是5.0,重新配置改成6.0就好了。具体步骤:项目右键Properties-->Java Complier,在“JDK Compliance”下面的“Compliercompliance level:”后面选择“1.6” 。
    
十七,为eclipse增加文档支持
    Look in Project > Properties, under Java Build Path in the Libraries tab, expand the desired JAR entry, click on Javadoc Location, and then click Edit. Browse to the javadoc location, click OK, and you are done.

十八,更改eclipse注释日期中文
    在eclipse.ini中增加如下两行
    -Duser.language=zh
    -Duser.region=CN
    设置注释模板的入口: Window->Preference->Java->Code Style->Code Template 然后展开Comments节点就是所有需设置注释的元素
    
十九,eclipse热键
    热键是Eclipse常用技巧中最常见的一个了。平时使用eclipse编程中,我最常用的三个组合热键:
    1.alt+/ 代码提示功能,编程中首选热键 熟悉delphi编程的同事经常把它改为ctrl+space
    2.ctrl+shift+f 代码排版 为了是你写的程序代码版面更清晰,你可以尝试使用该热键
    3.ctrl+shift+o 整理你的import部分的内容,会把多余的import项清理掉
    更多的热键可以在Window->Preferences->General->Keys查看

二十,有些代码或注释在几乎每个类中都要出现,我想使用方便的方法来自动生成,我该怎么办呢?
    eclipse中可以自定义模板,只需要输入模板的名称,就可以帮你生成你预先定义好的模板代码。
    个性的注释,log4j记录器等都可以自定义模板,让eclipse帮你方便的生成你所需要的代码。
    Eclipse自定义模板在window->preferences->java->editor->templates中设置。
    
二十一,Ctrl + Shift + F 格式化
    Java -> Code Style -> Formatter -> Edit -> Line Wrapping -> Maximum line width: 120
    Window -> Preferences -> MyEclise -> Files and Editors -> HTML -> HTML Source -> Line Width: 120
    
二十二,自定义myeclipse的工具栏,这样不必占两行了
Window-->Customized Perspective-->Commands
然后根据自己的喜欢在多选框上选择就可以了

二十三,快速定位某个配置项
菜单栏选择window—>preferences,在type filter text中输入tomcat

(18)Console 最大行数
Window-->Preferences-->Run/Debug-->Console 中的Console buffer size 1000000

(19)禁用拼写检查
Window-->Preferences-->General-->Editors-->Text Editors-->Spelling 取消掉

(20)有选择性的发布jar
右击项目-->Properties-->MyEclipse-->Web-->Deployment 看清楚后选择要发布的jar项

(21)MyEclipse8.6更改Jsp和Servlet模板
打开com.genuitec.eclipse.wizards_8.6.0.me201007140905.jar,
修改template/Servlet.java和template/jsp/Jsp.vtl及JSPMetaTags.vtl

(22)使用eclipse生成文档 Javadoc
        1. 进入Javadoc对话框
            a. 用菜单选择:File->Export->Javadoc->Next 然后选择项目
            b. 在项目列表中按右键,选择Export,然后在Export对话框中选择java下的javadoc,提交到下一步。
            c. 选中要生成文档的项目,然后用菜单选择,Project->Generate Javadoc直接进入Javadoc Generation对话框
            
        2. 各种选项基本上以默认为准,有一个注意的地方。
        如果源文件编码使用了UTF-8编码,那么生成的Javadoc文档可会有乱码。
        在第三个对话框的"Extra Javadoc options" 文本框里面加上
            -encoding UTF-8 -charset UTF-8
        
        3. 按Finish提交即可开始生成文档。
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值