Charles Bell
Posts: 519
Nickname: charles
Registered: Feb, 2002
|
|
Re: first timer
|
Posted: Nov 13, 2004 9:27 AM
|
|
If the file is named "HelloWorldApp.java" then you compile it with the command:
javac HelloWorldApp.java
If the file is named "helloworld.java" then you compile it with the command:
javac helloworld.java
You get the error error: cannot read HelloWorldApp.java when the executable javac cannot find the file named "HelloWorldApp.java"
The compiler looks in the current dirctory to find it. You can change where the executable looks with the switch -sourcepath. You can see compiler options by entering javac at the prompt with no arguments.
That should give a dump of the following:
C:\j2sdk1.4.2_04\projects\Test>javac
Usage: javac <options> <source files>
where possible options include:
-g Generate all debugging info
-g:none Generate no debugging info
-g:{lines,vars,source} Generate only some debugging info
-nowarn Generate no warnings
-verbose Output messages about what the compiler is doing
-deprecation Output source locations where deprecated APIs are u
ed
-classpath <path> Specify where to find user class files
-sourcepath <path> Specify where to find input source files
-bootclasspath <path> Override location of bootstrap class files
-extdirs <dirs> Override location of installed extensions
-d <directory> Specify where to place generated class files
-encoding <encoding> Specify character encoding used by source files
-source <release> Provide source compatibility with specified release
-target <release> Generate class files for specific VM version
-help Print a synopsis of standard options
|
|