---
title: "Eclipse 高亮显示选中的相同变量"
author: "nello"
date: "2012-01-12T14:53:06Z"
tags: []
categories: ["开源软件"]
slug: "eclipse"
draft: false
lastmod: "2012-01-12T14:53:06Z"
id: 1343467
url: "https://technique-digest.iteye.com/blog/1343467"
---

**问题描述：**

   在 eclipse 中使用快捷键或其他原因，不小心按错了，使得变量的高亮显示没了。 

**1.网友解决方法： **

选择:windows-> preferences->java->Editor->Mark Occurences 

选择最上的复选框，下面的就有很多了。 

其中的Local variables就是变量的高亮显示。 

![](http://dl.iteye.com/upload/attachment/0062/0393/c0a84108-8b7c-350d-8800-b5f52e1b7f5f.png)

**2.也有更简单的办法： **

网上搜了一下，原来是Toggle Mark Occurrences (Alt + Shift + 0)
这个按钮没有按下，在工具栏的小黄颜色的笔 的形状的图标。 

**3.改变其颜色： **

选择:windows-> preferences->java->Editor->Mark Occurences->第一行有个“Annotations”点击进入，显示出列表，找到 Occurrence annotation 右边选择Color即可。