Can't properly compile and run program - No Class Def Found Error
Can't properly compile and run program - No Class Def Found Error
Source code
I'd like to properly compile and run the program, but the solutions I've tried aren't working.
javac src/main/java/ReceitoDromo.java
Output
Note: ReceitoDromo.java uses unchecked or unsafe operations
Note: Recompile with -Xlint:unchecked
Exception
java src.main.java.ReceitoDromo
Error: Could not find or load main class src.main.java.ReceitoDromo
ReceitoDromo.class
java ReceitoDromo
1 Answer
1
There might be some syntax error in code. Mostly it happens when you use collections without type specifiers.
eg- you have to specify
ArrayList< Integer >() for older version of java as you can't use ArrayList()<>
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
open the command line, go to the folders where your
ReceitoDromo.class
file is, and invokejava ReceitoDromo
. What is your output?– Daniele
Jul 1 at 17:49