i am a newbie in java programming. given suggestion by most user, i download a pdf file of Bruce Eckel's "Thinking in Java 4th Edition", but i stuck in the first program, and i tried to surf net to find solution to solve it, but no luck, i believe it is a small problem, hoping any expert can help me.
first, i am using netbean ide 7.1 with jdk1.7.0_02, according to url http://www.mindviewinc.com/TIJ4/CodeInstructions.html, i install the TIJ4 source code in the directory D:\data\project\java\TIJ4-code. i also change the environment CLASSPATH=.;C:\Program Files\Java\jre6\lib\ext\QTJava.zip;D:\data\project\java\TIJ4-code;. on the other hand, i create a new project named shortform.java, and the source code is listed as below :-
public class Shortform { public static void main(String[] args) { print("This is a test"); } } // end
to run the program, i need to add a D:\data\project\java\TIJ4-code folder into shortform->project properties->libraries->Compile section, according to the example in the book, the sample use "import static net.mindview.util.Print.*;" statement, but the netbean compilier show a error on the editor, the error is "Import section does not correspond to the specified code style rules.", so i change to "import static net.mindview.util.Print.print;", then the error is gone. when i click the "test project (shortform)" (alt-F6), the error is show as below :-
// start ------------------------------------------------- init: Deleting: D:\data\project\java\test\shortform\build\built-jar.properties deps-jar: Updati ng property file: D:\data\project\java\test\shortform\build\built-jar.properties init: deps-clean : Updating property file: D:\data\project\java\test\shortform\build\built-clean.properties Deleting directory D:\data\project\java\test\shortform\build clean: Created dir: D:\data\project\java\test\shortform\build\classes Created dir: D:\data\project\java\test\shortform\build\empty Created dir: D:\data\project\java\test\shortform\build\generated-sources\ap-source-output Co mpiling 1 source file to D:\data\project\java\test\shortform\build\classes D:\data\project\java\test\sho rtform\src\shortform\Shortform.java:8: error: package net.mindview.util does not exist import static net.mindview.util.Print.print; D:\data\project\java\test\shortform\src\shortfor m\Shortform.java:8: error: static import only from classes and interfaces import static net.mindview.util.Print.print; D:\data\project\java\test\shortform\src\shortfor m\Shortform.java:26: error: cannot find symbol print("This is a test"); symbol: method print(String) location: class Shortform 3 errors D:\data\project\java\test\shortform\nbproject\build-impl.xml:605: The following error occurred while executing this line: D:\data\project\java\test\shortform\nbproject\build-impl.xml:246: Compile failed; see the compiler error output for details. BUILD FAILED (total time: 0 seconds) // end ----------------------------------------------------
anyone please help me if u know the problem, thanks