bostonianinmo0874
Joined: 24 May 2004 Posts: 2
|
Posted: Mon Oct 25, 2004 10:19 am Post subject: Java Compilar won't compile? |
|
|
| Okay, today I downloaded and installed the Java development kit from the sun website. I tried to compile a program, and it worked fine. Then, I tried to make another program, but when I was in MS-DOS the compiler just put me back to my current directory. I checked and the compiled file had not been generated. It was even in the right path, and didn't give me any error messages. I have reinstalled the development kit 3 times, so I want to know what to do! I am good with computers, but this baffles me. If you have any suggestions, please tell me. I will not reinstall it again, either. PLEASE HELP ME! |
|
janus
Joined: 02 Dec 2004 Posts: 4
|
Posted: Sun Nov 28, 2004 1:41 pm Post subject: Java Compilar won't compile? |
|
|
| Make sure your CLASSPATH variable are set correctly. Do a google search for more details.Make certain your java class is legal i.e. class name is the same as the file name, the class is public, there should also be a function with the following prototype:public static void main(String [ ] args) { }The default constructor should be public:public MyJavaClass() { }You could also try to type the full path name of the javac binary file when you attempt to compile your java class:C:Program FilesJavainjavac MyJavaClass.javaOr try using an IDE. NetBeans is free and you could try to create your java class in NetBeans and compile using NetBeans. |
|