Java 基础 之开发工具Eclipse & 使用eclipse构建HelloWorld

Java 基础 之开发工具Eclipse & 使用eclipse构建HelloWorld


eclipse很久不用了。现在个人工作中使用的是idea,这里记录下很久以前自己编写的笔记, 勿忘初❤

Eclipse的配置

切换为java透视图: window—>Perspective—>open Perspective—>other—>java

重置透视图: window—>Perspective—>reset Perspective

Package Explorer :包资源管理器,用来管理项目的包

入门演示如何创建项目

file--->New--->Java Project

项目结构 :

	 jre :运行环境

	 src: 存放源码

	1 创建包 ,公司域名的倒置   www.baidu.com   com.baidu.helloworld   
	                                          com.qf.helloworld  小写

	2 创建类,类名HelloWorld

	3 编写代码 

	4 运行  点击run按钮

配置Eclipse

1 修改字体大小  window-->preferences--->输入font---->colors and fonts
                                             --->basic--->text font

2 修改编码 utf-8   window-->preferences--->
                             输入 encoding--> workspace-->  other utf-8                 

3 修改代码提示  window-->preferences--->
                            输入 assist --->java--editor> content assist

abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ(@,

常用快捷键的介绍

常见模板代码(代码片段)
main—>主函数
sysout—>输出语句
自定模板
window–>preferences–>java—>editor—>templates
添加模板
psvm
public static void main(String[] args){
${cursor}
}

ctrl+D:删除一行
ctrl+shift+f:格式化代码
ctrl+S:保存文件
ctrl+/:单行注释
ctrl+/:取消单行注释
ctrl+f11:运行

参考资料

可参考http://www.runoob.com/eclipse/eclipse-create-java-project.html 【来源菜鸟教程】

猜你喜欢

转载自blog.csdn.net/l1996729/article/details/106563322