# Eclipse 安装与配置

## 目录

* Eclipse 安装
* Eclipse 配置
  * 1.tab 变为4个空格:
  * 2.Eclipse配色方案插件
  * 3.停止Eclipse里面**DLTKindexing**进程

## Eclipse 安装

[Eclipse 官方下载地址](https://www.eclipse.org/downloads/)

[Eclipse for PHP Developers](http://www.eclipse.org/downloads/packages/eclipse-php-developers/neon3)

由于最版本一般对java的版本有最新的要求,所以可以选择考虑早期版本的[Eclipse](https://www.gitbook.com/book/xiaoxiami/php-7/edit#)列表

注意:php7的开发的话下载最新版本的[Eclipse for PHP Developers](https://www.gitbook.com/book/xiaoxiami/php-7/edit#)即可,会集成php7及以上开发环境,

> 这里我使用的版本: Neon.3 Release (4.6.3)

![](/files/-LfnTFmVl6elImcWxzOT)

需要java 1.8版本

```
$ sudo apt-get install python-software-properties
$ sudo add-apt-repository ppa:webupd8team/java
$ sudo apt-get update
$ sudo apt-get install oracle-java8-installer
```

## Eclipse 配置

### 1.tab 变为4个空格:

1.点击 window->preference-,依次选择 General->Editors->Text Editors,选中右侧的 insert space for tabs;如下图所示，保存，第一步完成；

![](/files/-LfnTGrtlBxMr5vyalxP)

2.点击 window->preference-,依次选择PHP->code style ->formatter,点击右侧的editor，选则左侧 tab policy的值为spaces only,确定，应用保存即可，如下图所示：

![](/files/-LfnTGrv5QSzrNEK6FAG)

点击Edit 进行修改成Space:![](/files/-LfnTGrxdXwMtA_FGCVE)

![](/files/-LfnTGrzupS--cL8uaj8)![](/files/-LfnTGs0rjlBobFUlUwF)

### 2.Eclipse配色方案插件

插件主页：<http://eclipsecolorthemes.org/>

**安装步骤:**

1. 打开: `Help -> Eclipse Marketplace`
2. 查找 **Eclipse Color Theme**，会找到这个插件。
3. 进行安装

**配置:**

打开`Window->Preferences->General->Apperance`,会出现Color Theme,就可选择主题了![](/files/-LfnTGs2bWiERNfrbhwi)

### 3.停止Eclipse里面**DLTKindexing**进程

后台一直在运行一个**DLTK indexing** 的进程，导致Eclipse反应缓慢,直到强制关闭,停止该进程对一般开发者没有多大影响。

解决方案:删除workspace下的以下目录，然后重启eclipse，万事大吉！


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://php7.shujuwajue.com/kai-fa-gong-ju/eclipse-an-zhuang-yu-pei-zhi.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
