---
title: "eclipse使用技巧"
author: "xls"
date: "2011-12-05T20:57:21Z"
tags: []
categories: ["非技术"]
slug: "eclipse"
draft: false
lastmod: "2014-05-08T11:52:43Z"
id: 1292544
url: "https://xls.iteye.com/blog/1292544"
---

**1.怎样改变eclipse默认的jsp 打开方式**

preferences-&gt;General-&gt;editors－&gt;Files Associations（位置根据具体eclipse版本会有所不同）  
File Types 选择.jsp  
assiciations 里选择classic jsp editor，然后点右边的default

 

**2.删除eclipse中的workspace**

删除workspace空间的目录之后，在重新启动eclipse的时候还是能看到以前的workspace。eclipse的目录里面找相关的文件，.settings目录里面有一个 org.eclipse.ui.ide.prefs文件，用编辑器打开看到下面的一段：

RECENT\_WORKSPACES=D\\:\\\\web\\\\workspace,D\\:\\\\web,C\\:\\\\Documents and Settings\\\\Administrator\\\\workspace

这就是系统建立的一个workspace空间和自己建立的两个workspace空间，把这句改为RECENT\_WORKSPACES=D\\: [\\\\web\\\\workspace]()，保存文件然后重新启动eclipse，这时在选择工作空间的对话框的地方再也找不到那删除的两个工作空间了。

 

**3.Eclipse中防止代码格式化时(Ctrl+Shift+F)出现换行的情况**

打开Eclipse的Window菜单，然后Preferences-&gt;Java-&gt;Code Style-&gt;Formatter-&gt;Edit/Show(Eclipse版本不同，此处会稍有差别) -&gt;Line Wrapping-&gt;Maximum line width:由80改一下就行了，一般140比较合适。

**4.eclipse工程目录中不显示红叉（代码错误提示）**  
 没留意设置了什么地方导致eclipse目录不能显示代码编译不过所提示的红叉。后来找到原因并做如下修改错误提示就出来了

项目上右键--&gt;properties--&gt;java compiler--&gt;building--&gt;enable project specific setting--&gt;build path problems--&gt;选中abort Incomplete build path/Circular dependencies 这两个选项修改为Warning

**5.Eclipse中svn项目标记,F5刷新后消失了**

**Window-&gt;Preferences-&gt;Appearence-&gt;Label Decorations .**   
**把SVN勾上**

1. 马上就不起作用了，打开eclipse workspace中的.log看到提示：
   
   ```
   !MESSAGE Exception in Decorator. The 'SVN' decorator will be disabled.
   ```
2. 原因：可能某个项目的svn共享有问题，导致svn装饰被禁止，可以通过查看eclipse的日志获得此信息
3. 解决：有问题的项目选择team-&gt;disconnect shared即可，再重新选择svn装饰