XP - java not compiling
Posted: Wed Jun 19, 2002 8:41 pm
Hi,
I am a new JAVA student trying to compile a very simple program using software from the Java 2 SDK CD from the Dietel book. I installed the software on my PC, along with a trial version of TextPad (to use as a text editor). If it matters, I have Windows XP installed on my PC.
Here's the source code:
import javax.swing.*;
public class program1
{
public static void main (String s[])
{
// body of main method
JOptionPane.showMessageDialog(null, "Hello!");
System.exit(0);
}
}
----------------------------------------
Here's the response in TextPad, after I attempt to "Compile Java":
javac: invalid argument: C:\CIS217\program1.JAVA
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
-O Optimize; may hinder debugging or enlarge class file
-nowarn Generate no warnings
-verbose Output messages about what the compiler is doing
-deprecation Output source locations where deprecated APIs are used
-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
-target <release> Generate class files for specific VM version
Tool completed with exit code 2
-----------------------------------------------------
It's as if the Java compiler isn't even recognizing my file. I have updated the autoexec.bat file to include the path for the Java executable file. Anyone know what I'm doing wrong???
Any help would be greatly appreciated! Thanks!
I am a new JAVA student trying to compile a very simple program using software from the Java 2 SDK CD from the Dietel book. I installed the software on my PC, along with a trial version of TextPad (to use as a text editor). If it matters, I have Windows XP installed on my PC.
Here's the source code:
import javax.swing.*;
public class program1
{
public static void main (String s[])
{
// body of main method
JOptionPane.showMessageDialog(null, "Hello!");
System.exit(0);
}
}
----------------------------------------
Here's the response in TextPad, after I attempt to "Compile Java":
javac: invalid argument: C:\CIS217\program1.JAVA
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
-O Optimize; may hinder debugging or enlarge class file
-nowarn Generate no warnings
-verbose Output messages about what the compiler is doing
-deprecation Output source locations where deprecated APIs are used
-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
-target <release> Generate class files for specific VM version
Tool completed with exit code 2
-----------------------------------------------------
It's as if the Java compiler isn't even recognizing my file. I have updated the autoexec.bat file to include the path for the Java executable file. Anyone know what I'm doing wrong???
Any help would be greatly appreciated! Thanks!