Thinking in Java 4th Edition Source Code

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 the Java JDK SE5 or later from the download site at Sun. 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. Note that the most reliable approach is to install to the default directories.
  5. Add the bin directory of your JDK to your path.
  6. 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.
  7. 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.
  8. 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.
  9. 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.
  10. 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).
  11. 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."

  12. 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;.
  13. 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 while you're getting started; instead, you may want to begin with a more basic editor like JEdit.

You may also want to add yourself to the low-volume newsletter to find out about future books, supplements, seminars and public speaking events by Bruce Eckel.

Return to Thinking in Java 4th Edition

Thinking in Java 4th Edition Source Code的更多相关文章

  1. [转]Native Java Bytecode Debugging without Source Code

    link from:http://www.crowdstrike.com/blog/native-java-bytecode-debugging-without-source-code/index.h ...

  2. Artistic Style 3.1 A Free, Fast, and Small Automatic Formatter for C, C++, C++/CLI, Objective‑C, C#, and Java Source Code

    Artistic Style - Index http://astyle.sourceforge.net/ Artistic Style 3.1 A Free, Fast, and Small Aut ...

  3. Java Sound : generate play sine wave - source code

    转载自:http://ganeshtiwaridotcomdotnp.blogspot.com/2011/12/java-sound-generate-play-sine-wave.html Work ...

  4. Sound (audio file) player in java - working source code example

    转载自:http://ganeshtiwaridotcomdotnp.blogspot.com/2011/12/sound-audio-file-player-in-java-working.html ...

  5. 转: Source Code Lookup in Eclipse(主要讲的是java的)

    Source Code Lookup in Eclipse https://www.intertech.com/Blog/source-code-lookup-in-eclipse/

  6. view class source code with JAD plugin in Eclipse

    The default class viewer doesn't decompile the class file so you cannot open and check the source co ...

  7. Attach source code to a Netbeans Library Wrapper Module

    http://rubenlaguna.com/wp/2008/02/22/attach-source-code-to-a-netbeans-library-wrapper-module/ Attach ...

  8. Memcached source code analysis (threading model)--reference

    Look under the start memcahced threading process memcached multi-threaded mainly by instantiating mu ...

  9. 3 Ways of JDK Source Code Attachment in Eclipse---reference

    You wanna look at a JVM class while you are coding and you cannot. Here is the solution. First of al ...

  10. 《Algorithms 4th Edition》读书笔记——3.1 符号表(Elementary Symbol Tables)-Ⅳ

    3.1.4 无序链表中的顺序查找 符号表中使用的数据结构的一个简单选择是链表,每个结点存储一个键值对,如以下代码所示.get()的实现即为遍历链表,用equals()方法比较需被查找的键和每个节点中的 ...

随机推荐

  1. ElasticSearch的使用和介绍

    1.概述 功能 Elasticsearch 是一个分布式的 RESTful 搜索和分析引擎,可用来集中存储您的数据,以便您对形形色色.规模不一的数据进行搜索.索引和分析. 例如: 在电商网站搜索商品 ...

  2. 用AI技术实现自动化的社交媒体广告投放,提高广告效果和收益

    目录 1. 引言 2. 技术原理及概念 2.1 基本概念解释 随着社交媒体的普及,广告投放已经成为了广告行业的重要一环.在过去的几年中,社交媒体广告投放的效果和收益都得到了显著提高,但同时也存在着一些 ...

  3. Taurus .Net Core 微服务开源框架:Admin 插件【2】 - 系统环境信息管理

    前言: 继上篇:Taurus .Net Core 微服务开源框架:Admin 插件[1] - 微服务节点管理 本篇继续介绍下一个内容: 1.系统环境信息节点 - OS-Environment 界面 基 ...

  4. String解析及其方法

    String解析及其方法 1.前言 2.什么是字符串(String) 3.字符串(String)的两种创建方式及其区别 4.字符串(String)的方法及其部分原码解析 5.字符串(String)的弊 ...

  5. 【从0开始编写webserver·基础篇#03】TinyWeb源码阅读,还是得看看靠谱的项目

    [前言] 之前通过看书.看视频和博客拼凑了一个webserver,然后有一段时间没有继续整这个项目 现在在去看之前的代码,真的是相当之简陋,而且代码设计得很混乱,我认为没有必要继续在屎堆上修改了,于是 ...

  6. 如何开发 RESTful、GraphQL 和 SOAP 等不同类型的 API ?

    在软件开发中,API(应用程序编程接口)的重要性不言而喻.API已成为不可或缺的构建模块,使开发人员能够创建功能丰富.多样化和可扩展的应用程序.这是一篇综合指南,旨在深入探讨API开发,使初学者和有经 ...

  7. 我开源了团队内部基于SpringBoot Web快速开发的API脚手架stater

    我们现在使用SpringBoot 做Web 开发已经比之前SprngMvc 那一套强大很多了. 但是 用SpringBoot Web 做API 开发还是不够简洁有一些. 每次Web API常用功能都需 ...

  8. Go 语言 for-range 的两个坑,你踩过吗?

    坑一:迭代时协程引用索引和值 先看看下面的例子,你知道最终输出的结果是什么吗? package main import ( "fmt" "time" ) fun ...

  9. C语言循环坑 -- continue的坑

    文章目录 前言 一.continue语法 1.continue的作用 2.语法 二.大坑项目 题目 分析 正确写法 三.进坑调试 第一种 第二种 总结 前言 在使用continue和break时,会出 ...

  10. curl 调用url时带有&符号被截断

    转载请注明出处: 用curl命令在服务器上调试接口时,一直调试不通,执行如下: 在用curl 执行之后,返回了一个 作业id [ 1 ] 23926 ; 并打印出了 调用执行的url,发现 真正执行的 ...