JDK1.3 compilation question?
Why when I use javac.exe compile the programme,it always reply "Javac:invaild argument:'my filename .java' "
I have set the path and class path ,java_home,the class name is also as the same as the file name.
Could u tell me why?
Thank u!
By the way,must useing javac.exe compile the programme be in DOS enviroment?If not,please tell me all the methods you have know(Please tell me the details)
thank u!
IF you could ,please send me the e-mail.
THANK YOU!
e-mail:mpokky@citiz.net
mpokky@sohu.com
[573 byte] By [
mpokky] at [2007-9-26 18:38:42]

Hello mpokky,
The error "Invalid argument" means that you passed in arguments which javac could not understand. When you are compiling a .java file with "javac", you have to run it in the following form:
javac file.java
And when you run "java" to run the class file, you need to make sure you have the directory which holds the class file in your CLASSPATH. When running "java", it is called in the following form:
java file
Where you don't include the ".class" after file.
The above suggestions are for running java and javac in a DOS or in a Unix shell environment. There are many IDEs such as Forte For Java which will compile and run your .java and .class files by just clicking "compile" or "run" from a graphical menu.
Both DOS/Shell and IDE environments are great for Java development.
Hope this helps,
Ming
Developer Technical Support
http://www.sun.com/developers/support
In your first post, you have a space between my and filename and between filename and .java. This won't work. In your second post, you have only .java. This won't work either. You have to type javac followed by a space and the file name you want to compile. The file name must end with .java. For example, if you are trying to create a class named MyClass, you must save the source code text as a file named MyClass.java. Then, to compile, CD to the directory where MyClass.java is and use the command
javac MyClass.java