13.07.2015 Views

Java™ Application Development on Linux - Dator

Java™ Application Development on Linux - Dator

Java™ Application Development on Linux - Dator

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

118Chapter 5The Sun Microsystems Java Software <str<strong>on</strong>g>Development</str<strong>on</strong>g> KitExample 5.2 Compiling FetchURL.java with the -verbose opti<strong>on</strong>$ javac -verbose FetchURL.java[parsing started FetchURL.java][parsing completed 479ms][loading /usr/java/j2sdk1.4.1_02/jre/lib/rt.jar(java/lang/Object.class)][loading /usr/java/j2sdk1.4.1_02/jre/lib/rt.jar(java/net/URL.class)][loading /usr/java/j2sdk1.4.1_02/jre/lib/rt.jar(java/lang/String.class)][checking FetchURL][loading /usr/java/j2sdk1.4.1_02/jre/lib/rt.jar(java/lang/Excepti<strong>on</strong>.class)][loading /usr/java/j2sdk1.4.1_02/jre/lib/rt.jar(java/lang/Throwable.class)][loading /usr/java/j2sdk1.4.1_02/jre/lib/rt.jar(java/io/BufferedReader.class)][loading /usr/java/j2sdk1.4.1_02/jre/lib/rt.jar(java/io/InputStreamReader.class)][loading /usr/java/j2sdk1.4.1_02/jre/lib/rt.jar(java/net/URLC<strong>on</strong>necti<strong>on</strong>.class)][loading /usr/java/j2sdk1.4.1_02/jre/lib/rt.jar(java/io/Reader.class)][loading /usr/java/j2sdk1.4.1_02/jre/lib/rt.jar(java/io/InputStream.class)][loading /usr/java/j2sdk1.4.1_02/jre/lib/rt.jar(java/lang/System.class)][loading /usr/java/j2sdk1.4.1_02/jre/lib/rt.jar(java/io/PrintStream.class)][loading /usr/java/j2sdk1.4.1_02/jre/lib/rt.jar(java/io/FilterOutputStream.class)][loading /usr/java/j2sdk1.4.1_02/jre/lib/rt.jar(java/io/OutputStream.class)][loading /usr/java/j2sdk1.4.1_02/jre/lib/rt.jar(java/lang/Error.class)][loading /usr/java/j2sdk1.4.1_02/jre/lib/rt.jar(java/net/MalformedURLExcepti<strong>on</strong>.class)][loading /usr/java/j2sdk1.4.1_02/jre/lib/rt.jar(java/io/IOExcepti<strong>on</strong>.class)][loading /usr/java/j2sdk1.4.1_02/jre/lib/rt.jar(java/lang/RuntimeExcepti<strong>on</strong>.class)][loading /usr/java/j2sdk1.4.1_02/jre/lib/rt.jar(java/lang/StringBuffer.class)][wrote FetchURL.class][total 3469ms]$the applicati<strong>on</strong>, either directly through compositi<strong>on</strong> or inheritance, or indirectlybecause the classes we used are themselves composed of or inherit from otherclasses. How did the Java compiler know where to find these classes? For this,it used what the Sun documentati<strong>on</strong> calls a bootstrap classpath, which is set whenthe SDK is installed. A classpath is a list of directories and/or JAR files that aresearched for classes. We seem to dimly recall that in early versi<strong>on</strong>s of Java, therewas <strong>on</strong>ly <strong>on</strong>e classpath, and if you changed it, you had to remember to put theJava runtime JAR file <strong>on</strong> it, or n<strong>on</strong>e of the standard APIs were available. This,no doubt, is why Sun created the c<strong>on</strong>cept of a bootstrap classpath. If you useany third party JAR files or you create your own, you must tell the compilerabout it by creating your own classpath.There are two ways to provide a classpath to the Java compiler. One isthrough a command-line switch, which we will cover in a moment. The otheris through an envir<strong>on</strong>ment variable. The CLASSPATH envir<strong>on</strong>ment variable lists

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!