August 22, 200619 yr Hi all, Recetnly have been trying to learn Java and i started on a tutorial on sun. How ever i have a common problem and ive tried their solution and it doesnt work. I compile my application into the .class then when i type in: C:\java2\bin>java HelloWorldApp i get the no class defination file. I set the directory to the right place and it still says that. Also my class file for somereason has become a java file that when i try to alter it into open with standard binary it says corrupt file. Any ideas on what i should do? thanks
August 22, 200619 yr First of all, it's probably best to add javac[Caution: Executable File] (The compiler) to your environmental variables. Second of all, your missing the extension. It outputs AppName.class You have to run it using java AppName.class
August 23, 200619 yr Author Typed in this: C:\java2\bin>java HelloWorldApp.class this came up: Exception in thread "Main" java.lang.NoClassDefFoundError: HelloWorldApp/class whats with that?
August 23, 200619 yr i am taking a java class in high school so i can help you in about a school year lol [\url]
August 24, 200619 yr Author sorted the problem, java didnt recongnise the class directory, here is what i had to type C:\java2\bin> java -classpath . HelloWorldApp
Create an account or sign in to comment