搭建eclipse开发环境

时间:2022-05-05 08:12:24
eclipse常用操作

eclipse文件说明:
/opt/eclipse/:包含工作空间的默认配置
~/.eclipse/:包含工作空间的默认配置
~/workspace/.metadata/:包含工作空间的配置
~/workspace/.metadata/.plugins/org.eclipse.core.runtime/.settings/:工作空间配置
~/workspace/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.editors.prefs: wordwrap.enabled=true自动换行
~/workspace/.metadata/.log:日志
~/.p2/ 基本配置:
快捷查找: window->perferences->搜索框搜索
utf8: window->perferences->general->workspace
列边际线: window->perferences->general->editors->text editors
字体: window->perferences->general->Appearance->colors and fonts
运行设置: window->perferences->Run/Debug->Launching
快捷键设置: window->perference->general->keys
文件的默认打开方式: window->perference->general->Editors->File Associations选中*.sh,然后再下方设置默认的编辑器
tab替换: window->perferences->general->editors->text editors
xml-tab替换: Windows > Preferences > XML > XML Files > Editor > xxx
选中,相同变量高亮: windows-> preferences->java->Editor->Mark Occurences
滚动条: windows-> preferences->PyDev>编辑器>概述标尺Minimap 异常弹窗处理:删除maven插件
把C:\Users\Administrator\.m2\repository\org\apache\maven\plugins下的文件删除 java模板设置,不要换行,出现tab,
https://*.com/questions/3754405/best-eclipse-code-formatters/18417393
https://github.com/google/styleguide
https://raw.githubusercontent.com/google/styleguide/gh-pages/eclipse-java-google-style.xml save格式化
java
Windows->Preferences->java->Editor->Code style->Formatter->google
window->perferences->java->Editor->Save Actions
python
Windows->Preferences->Pydev->Editor->Code Formatter->autopep8
Windows->Preferences->Pydev->Editor->save Actions->auto-format选中
python
https://blog.csdn.net/sunylat/article/details/53857596 java方法提示,设置
Window > Preferences > Java > Editor > Content Assist->Auto Activation triggers for java
把“.”修改成".abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" 网络代理配置
window->perferences->general->network connection
注意:cleared the proxy settings for SOCKS protocol(可能导致install software失败)
https://*.com/questions/5857499/how-do-i-have-to-configure-the-proxy-settings-so-eclipse-can-download-new-plugin 安装插件的注意事项:
把【connect all update sites during install to find required software】的勾选去掉,否则在安装新插件时会联网寻找所有可能的更新站点搜索,导致安装时间不可预估,并可能导致安装失败。 添加shell的编辑器:
http://sourceforge.mirrorservice.org/s/sh/shelled/shelled/ShellEd%202.0.3/
下载net.sourceforge.shelled-site-2.0..zip
help->install new software->添加zip文件 关联shell解释器(未尝试过,待验证)
解释器下载地址
http://win-bash.sourceforge.net/
http://unxutils.sourceforge.net/ 安装python解释器
xxx eclipse安装python插件
help->install new software
location: http://pydev.org/updates eclipse关联python解释器
window->perferences->pyDev->Interpreters->python Interpreter
设置字符长度限制
pydev->editor->code style->code formatter设置parameters: --max-line-length= eclipse安装javafx插件
help->install new software
http://download.eclipse.org/efxclipse/updates-released/2.3.0/site 安装java Scene Builder
xxx 关联java Scene Builder
window->references->javafx->关联java scene builder安装路径 安装maven
xxx eclipse关联maven
window->references->Maven->Installations->add eclipse配置maven
添加window->references->Maven->lifecycle-mapping-metadata.xml
window->references->Maven->User Settings 安装markdown
插件包:https://github.com/winterstein/Eclipse-Markdown-Editor-Plugin/releases 安装tomcat
tomcat环境变量配置
CLASS_APTH:添加
%TOMCAT_HOME%\bin;%CATALINA_HOME%\lib TOMCAT_HOME
CATALINA_BASE
CATALINA_HOME
D:\Program Files\Apache Software Foundation\Tomcat 8.5 eclipse关联tomcat
Window -> Preferences -> Server -> Runtime Environmants -> add -> apache Tomcat(根据安装版本 选择 版本)
eclipse添加变量
window->java->build path->classpath variable->TOMCAT_HOME eclipse创建web项目:new Dynamic web project 将eclipse web项目发布tomcat目录下:
清空eclipse下的tomcat server的app:
clean tomcat working directory
设置server locations:
打开eclipse server配置:双击servers视图中的tomcat server
修改配置server locations为:
use tomcat installation
deploy path: webapps 将git-maven项目构建为eclipse-maven项目
执行mvn eclipse:eclipse后,import Existing Project 将git中的普通项目构建为eclipse项目
方式一:直接新建项目,正确填写project name和project directory即可。例如:project name: am, directory: E:\eclipse-workspace\first_path\am
方式二:创建一个同类型的项目,再讲git中的项目源码copy到eclipse项目文件夹中。
方法三:利用eclipse自带的git repositories导入git项目。 导入项目
import->Existing Projects into workspace
选中文件夹,eclipse会自动将所有的项目导入 导入maven子项目
import->Existing Maven Projects git项目->eclipse项目
show git视图
右击import projects
将导入的项目,构建为eclipse项目:mvn eclipse:eclipse maven dependencies缺失
ctrl+shift+.classpath
添加:
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
</attributes>
</classpathentry>