Instructions for downloading, installing and testing the source code
1. Download the source code zip file from this link.
2. Create a directory in which to install the code. For these instructions, we'll refer to this directory as C:\TIJ4\code.
3. Using Winzip or some other zip utility, extract the zip file into the C:\TIJ4\code directory. When you're done, you should see several levels of directories, and in the C:\TIJ4\code directory, you'll see, among other things, subdirectories corresponding to the chapters in the book.
4. Install Java SE5 from the download site at Sun. Select the "Download JDK 5.0" link. You'll also eventually want the documentation, which is available further down on that page. You may also choose to install Java SE6; the code will work with that as well.
5. Set the CLASSPATH in your computer's environment. For Windows machines, right-click on the "My Computer" icon and select "Properties." Then select the "Advanced" tab and click the "Environment Variables" button at the bottom. Under "System Variables," look to see if there's already a "CLASSPATH" variable. If there is, double click and add
;.;..;C:\TIJ4\code;
to the end of the current entry. If there is no "CLASSPATH" variable, click the "New" button and enter
CLASSPATH
In the "Variable name" box, and
.;..;C:\TIJ4\code;
In the "Variable value" box, then click "OK". To verify that your classpath has been set, start a command prompt (see below), then enter set and look for the CLASSPATH information in the output.
6. Install the Ant build tool by following the instructions you will find in the Ant download. Note: Ant is not required in order to compile the examples in the book. It is used to automate the process, but you can also compile each example individually (once you have the CLASSPATH set, as described above) using the javac command-line compiler that was installed when you completed the previous step (note that you may have to set the Windows PATH to point to javac.exe). To compile a file called MyProgram.java, you type javac MyProgram.java.
7. Start a command prompt in the C:\TIJ4\code directory. To do this in Windows, press the "Start" button, then select "Run" and type "cmd" and press "OK." then type
cd C:\TIJ4\code
into the resulting command window.
8. At this point you should be able to start a command prompt in C:\TIJ4\code and type ant build, and the build should successfully compile all the chapters up to the io chapter, where it will fail with an error message about a missing library. If you only need to work with chapters before io for now, this will suffice for awhile.
9. You can also move into individual chapters and type ant (to compile and execute the code in that chapter) or ant build (to compile the code only).
10. To build the entire code base, you'll need to install the additional libraries. These include:
* XOM
* Javassist
* The javaws.jar library, which comes with the standard Java installation, but which you must explicitly place in your classpath (described below).
* The Eclipse SWT library. Click on the most recent build number, then scroll down to "SWT Binary and Source" and select the file corresponding to your platform. Further details about finding the jar file are in the book under the heading "Installing SWT."
In general, you can install the above Jar files by placing them in the jre/lib/ext directory that is part of the "Java Runtime" that will be set up when you install the Java SE5 or Java SE6 development kit. You may have to hunt around for the JRE, but it can often be found under your "Program Files" directory, under "Java."
11. Alternatively, you can explicitly install each of the Jar files. To do this, you must add each one to your CLASSPATH, following the directions shown earlier on this page. However, you must also include the name of the Jar file in the CLASSPATH entry. For example, if you put the xom.jar file in a directory called C:\TIJ4\libraries\, then the associated CLASSPATH entry would be C:\TIJ4\libraries\xom.jar;.
12. This code is designed to work outside of IDEs. Because packages are not introduced until later chapters, and some of the fancier IDEs like Eclipse require all code to be in packages, if you want to use the code inside those IDEs you will have to make some adjustments (however, see the Eclipse.py program in the download package for some help). Different IDEs have different requirements and it may be more trouble than it's worth to get you started; instead, you may want to begin with a more basic editor like JEdit.
没有合适的资源?快使用搜索试试~ 我知道了~
Think in Java源码Maven工程(内附原始代码)
共3个文件
txt:1个
zip:1个
rar:1个
需积分: 9 11 下载量 164 浏览量
2016-08-05
11:02:50
上传
评论
收藏 2.37MB RAR 举报
温馨提示
编译Think in java 源代码 1.下载源码,按要求安装编译环境 2.执行Eclipse.py,初始化java代码 3.使用maven工程编译 新建maven工程,导入源码 4.修改pom.xml引入且少的jar包(xom.jar、swt.jar、javassit.jar) 5.新建lib目录,将tools.jar、javaw.jar拷贝至lib目录,工程内引入缺少的jar包 6.排错、编译
资源推荐
资源详情
资源评论
收起资源包目录
Thinking_in_Java_Fourth_Edition_Code.rar (3个子文件)
TIJ4-code-maven.rar 2.02MB
Instructions.txt 5KB
TIJ4-code.zip 542KB
共 3 条
- 1
资源评论
大江之中
- 粉丝: 25
- 资源: 5
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功