mardi 6 mai 2014

Java - problème de Classpath avec TIJ3 de Bruce Eckel - Stack Overflow


I'm having some trouble running an example from Bruce Eckel's Thinking in Java 3. Specifically, when I type


ant build 

from the code root directory, as instructed on the website, I am able to compile all examples up to chapter 14 (directory c14), which is normal because I haven't installed a couple of libraries required to build the targets of chapter 14. However, when I cd to the directory corresponding to chapter 3 (c03) and invoke javac on the Assignment.java file, I get the following:


jason@debian-laptop:~/code/tij3/code/c03$ javac Assignment.java 
Assignment.java:5: package com.bruceeckel.simpletest does not exist
...

where "..." refers to other compile-time errors which I get because of the compiler's inability to find the package com.bruceeckel.simpletest package.


My classpath, as you will note, includes the home code directory of TIJ3:


jason@debian-laptop:~/code/tij3/code/c03$ echo $CLASSPATH
.:..:/home/jason/code/tij3/code/

So I'm guessing that the directory tree nested in that directory should be well seen by the java compiler. After all, ant runs well. For the record, my Java version is 1.6.0_26:


jason@debian-laptop:~/code/tij3/code/c03$ java -version
java version "1.6.0_26"
Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
Java HotSpot(TM) Client VM (build 20.1-b02, mixed mode, sharing)

Any help with this would be immensely appreciated. Thank you,



I'm having some trouble running an example from Bruce Eckel's Thinking in Java 3. Specifically, when I type


ant build 

from the code root directory, as instructed on the website, I am able to compile all examples up to chapter 14 (directory c14), which is normal because I haven't installed a couple of libraries required to build the targets of chapter 14. However, when I cd to the directory corresponding to chapter 3 (c03) and invoke javac on the Assignment.java file, I get the following:


jason@debian-laptop:~/code/tij3/code/c03$ javac Assignment.java 
Assignment.java:5: package com.bruceeckel.simpletest does not exist
...

where "..." refers to other compile-time errors which I get because of the compiler's inability to find the package com.bruceeckel.simpletest package.


My classpath, as you will note, includes the home code directory of TIJ3:


jason@debian-laptop:~/code/tij3/code/c03$ echo $CLASSPATH
.:..:/home/jason/code/tij3/code/

So I'm guessing that the directory tree nested in that directory should be well seen by the java compiler. After all, ant runs well. For the record, my Java version is 1.6.0_26:


jason@debian-laptop:~/code/tij3/code/c03$ java -version
java version "1.6.0_26"
Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
Java HotSpot(TM) Client VM (build 20.1-b02, mixed mode, sharing)

Any help with this would be immensely appreciated. Thank you,


Related Posts:

0 commentaires:

Enregistrer un commentaire