Eclipse设置初始配置(Ⅰ.字体大小,Ⅱ.自动提示,Ⅲ.编码格式,Ⅳ.配置jdk,Ⅴ.配置Tomcat,Ⅵ配置【Maven】默认使用JDK1.8

Ⅰ.设置Eclipse字体大小

1.在最上面的工具栏里找到Window下的Preferences。如下图:

2.在弹出窗口中找到依次点击General(常规)—Appearance(外观)—Colors and Fonts(颜色和字体),打开该设置窗口,在中间的字体编辑菜单中找到第一项Basic(基本)—Text Font(文字字体)—Edit(编辑),点击编辑按钮打开字体编辑菜单。如下图:

3.在菜单中选择你想要设置的字体,和对应的字体大小,然后点击确定按钮,(为了方便看中文通常设置Courier New,这时如果你发现你字体里没有也不要担心,你只要点击左下角的【显示更多字体】在跳出的控制面板中就可以找到你想要的字体了,Apply and Close【应用并关闭】就ok了。如下图:

Ⅱ.自动提示

1.在最上面的工具栏里找到Window下的Preferences。如下图:

2.在弹出窗口中找到依次点击Java—Editor—Content Assist—Auto activation triggers for Java(Java自动激活触发器)把里面的内容替换为:.abcdefghijklmnopqrstuvwxyz再Apply and Close【应用并关闭】就ok了。如下图:

Ⅲ.Eclipse设置编码格式

1.设置工作空间编码格式

在上面工具栏找到Window—Preferences—General—Workspace—Text file encoding 选择UTF-8格式,Apply and Close【应用并关闭】就ok了。如下图:

2.设置JSP页面编码格式

在Window—Preferences—Web—CSS Files/HTML Files/JSP Files 面板选择 ISO 10646/Unicode(UTF-8)格式编码,Apply and Close【应用并关闭】就ok了。如下图:

3.设置文档编码格式

在Window—Preferences—General—Content Types—Text最下面的Default encoding里面设置字符编码格式为UTF-8再Update一下。如下图:

还可以打开 Text 把里面的 Java Properties File 等字符编码格式设置为 UTF-8 再 Update 一下,再 Apply and Close【应用并关闭】就ok了。如图:

4、设置项目的文档编码格式

选择项目—右键—Properties—Resource—Text file encoding里面设置字符编码为UTF-8格式,Apply and Close【应用并关闭】就ok了。如下图:

Ⅳ.Eclipse配置jdk

1.在Window—Preferences—Java—Installed JREs—Edit。如下图:

2.JRE home为你的安装路径,JRE name里面把jre改成jdk。如下图:

3.更改后,然后Finish完成。如下图:

4.再到Java—Compiler—Compiler compliance level里面选择对应的JDK版本(因为我的换成了JDK1.8的版本,所以下面会有一个感叹号的提示),再Apply and Close【应用并关闭】就ok了。如图:

Ⅴ.Eclipse配置Tomcat

1.在Window—Preferences—Server—Runtime Environments—Add。如下图:

2.根据自己下载的tomcat的版本,添加自己的版本后点击Next(我的是8.5版本的)。如下图:

3.Name为Tomcat服务器名字【用默认名字】,Tomcat installation directory为Tomcat服务器安装路径【选择自己安装的Tomcat路径】,JRE选择自己的jdk,再Finish完成,再Apply and Close就ok。如下图:

4.选择项目—右键—Run As—Run on Server—Next—Finish完成,就可以运行了。如下图:

Ⅵ.Eclipse配置【Maven】默认使用JDK1.8

1.在 apache-maven 文件夹下的 conf 文件夹里面的 settings.xml 文件里面添加以下两段代码,①为本地仓库的路径,里面的路径地址为自己定的,②为【maven】设置默认使用JDK1.8,③为私人服务器

① 配置本地仓库路径

<!-- 配置本地仓库路径 -->
<localRepository>D:/Program/Java/maven/repository</localRepository>

②设置默认使用JDK1.8

<!-- 全局jdk配置,settings.xml -->
<profile>  
    <id>jdk18</id>  
    <activation>  
        <activeByDefault>true</activeByDefault>  
        <jdk>1.8</jdk>  
    </activation>  
    <properties>  
        <maven.compiler.source>1.8</maven.compiler.source>  
        <maven.compiler.target>1.8</maven.compiler.target>  
        <maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion>  
    </properties>   
</profile>

③ 配置私人服务器

<!-- 配置镜像,设置私人访问器(私服)路径 -->
<mirror>
	<id>mirrorId</id>
	<mirrorOf>*</mirrorOf><!-- *表示任何资源下载必须使用下面路径 -->
	<url>http://maven.aliyun.com/nexus/content/groups/public</url><!-- 去阿里云下载 -->
</mirror>

2.在Window—Preferences—Maven—Installations—Add。如下图:

3.点击Finish完成。如下图:

4.配置完成,再Apply and Close就ok了。如下图:

5.在Window—Preferences—Maven—User Settings,User Settings是maven里面的settings.xml的存在路径,Update Settings一下,如果无错误的话,再Apply and Close就ok了。如下图:

6.为了方便项目迁移,也可以在pom文件中配置。具体如下:

<!-- jdk版本1.8,pom.xml -->
<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.2</version>
            <configuration>
                <source>1.8</source>
                <target>1.8</target>
                <encoding>UTF-8</encoding>
            </configuration>
        </plugin>
    </plugins>
</build>

  • 3
    点赞
  • 11
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值