2016年6月8日星期三

Reading Notes : Core Java Tenth Edition -- Chapter 2. The Java Programming Environment

1.  After you are done installing the JDK, you need to carry out one additional step: Add the jdk/bin directory to the executable path—the list of directories that the operating system traverses to locate executable files:
    a)    In UNIX (including Linux, Mac OS X, and Solaris), the procedure for editing the executable path depends on the shell you are using. If you use the Bourne Again shell (which is the Linux default), then add a line such as the following to the end of your ~/.bashrc or ~/.bash_profile file:
export PATH=jdk/bin:$PATH
    b)    Under Windows, log in as administrator. Start the Control Panel, switch to Classic View, and select the System icon. In the system properties dialog, click the Advanced tab, then click on the Environment button. Scroll through the System Variables window until you find a variable named Path. Click the Edit button. Add the jdk\bin directory to the beginning of the path, using a semicolon to separate the new entry, like this:
jdk\bin;other stuff

2.  The src.zip file contained in jdk has the source code for all public libraries. To obtain even more source (for the compiler, the virtual machine, the native methods, and the private helper classes), go to http://jdk8.java.net.

3.  The documentation is contained in a compressed file that is separate from the JDK. You can download the documentation from www.oracle.com/technetwork/java/javase/downloads.

4.  You can download the Core Java Program from http://horstmann.com/corejava.

5.  The javac program is the Java compiler. It compiles the .java file into the .class file. The java program launches the Java virtual machine. It executes the bytecodes that the compiler placed in the class file. The compiler requires a file name (Welcome.java). When you run the program, you specify a class name (Welcome) without a .java or .class extension.

6.  appletviewer is a special tool included with the JDK that lets you quickly test an applet. You need to give this program an HTML file name, rather than the name of a Java class file. The applet viewer has no capabilities to send mail or display a web page, and it ignores all HTML tags except for the applet tag.

7.  Many browsers do not have Java support enabled by default. The page http://java.com/en/download/help/enable_browser.xml shows how to set up the most common browsers for Java.

8.  You can temporarily configure Java to trust applets from the local file system. First, open the Java control panel.
• In Windows, look inside the Programs section of the control panel.
• On a Mac, open System Preferences.
• On Linux, run jcontrol.
Then click the Security tab and the Edit Site List button. Click Add and type in file:///. Click OK, accept another security prompt, and click OK again.

没有评论:

发表评论