Java2核心技术第七版的学习笔记(二):.The Java Programming Environment(Java的环境)

来源:互联网 发布:java for each 编辑:程序博客网 时间:2024/05/13 16:03

一、Installing the Java Development Kit(安装JDK)
1、到http://java.sun.com/javase/downloads/index.jsp下载最新的JDK。
2、设置环境变量。
   其中一个用户变量的名称为“path”,值为“.;d:/j2sdk/bin”,
   另一个用户变量的名称为"CLASSPATH",值为“.;d"/j2sdk/lib/dt.jar;d:/j2sdk/lib/tools.jar”,
   注意:文件夹名称中不能有空格存在
3、找一个测试文件测试一下,自求多福吧。


二、Choosing a Development Environment(选择开发环境)
1、Use the JDK and your favorite text editor. Compile and launch programs in a shell window.(选择你最喜欢的文本编辑工具,在控制台中进行编译和运行)
2、Use an integrated development environment such as Eclipse, or one of many other freely or commercially available development environments.(选择一个集成开发环境,比如Eclipse,或者其他的免费或者商业的开发环境)
3、Use the JDK and a text editor that is integrated with the JDK. Emacs, TextPad, and JEdit are so integrated, as are many others. Compile and launch programs inside the editor.(选择一个带有jdk的文本编辑器,比如Emacs , TextPad , JEdit等等,在文本编辑器中进行编译和运行。)


三、Using the Command-Line Tools(使用命令行方式)
1、在文本编辑器中编辑java源文件,必须保证文件的扩展名是.java。有的编辑器会自动加上.txt,并且显示的时候会隐藏后缀。一定要小心!!
2、假如保存的文件名称为Welcome.java,则在命令行中依次打入:javac Welcome.java和java Welcome。
3、Java是大小写敏感的,所以一定要保证是Welcome而不是welcome或WELCOME


四、Using an Integrated Development Environment(使用集成环境)
文中介绍的是Eclipse,官方网站是http://eclipse.org。


五、Compiling and Running Programs from a Text Editor(在文本编辑中进行编译和运行)
Emacs的官方网站是http://www.gnu.org/software/emacs/windows/ntemacs.html。
Textpad的官方网站是http://www.textpad.com。
JEdit的官方网站是http://jedit.org。


六、Running a Graphical Application(运行可视化程序)
与控制台程序运行的方法是相同的,只是其界面是窗体界面。


七、Building and Running Applets(建立和编译applet)
必须建立html和applet文件,以后再说吧。 

原创粉丝点击