0
When I compile with javac, it works normally but when I try to execute the compiled code ex:"java Integers" this appears: Error: Could not find or load main class Integers Caused by: java.lang.Noclassdeffounderror: javaLoiane/aula11/Integers (Wrong name: Integers) NOTE: When I try to run directly without compiling ex:"java Integers.java" the code also works normally, and this error is also happening in Vscode’s Runner code but it does not happen if it runs with Vscode’s own Java extension
package javaLoiane.aula11;
public class Inteiros {
public static void main(String[] args) {
final byte idade01 = 20;
final short idade02 = 21;
final int idade03 = 22;
final long idade04 = 23;
System.out.println("Valor variavel idade01 = " + idade01);
}
}
Could you show the commands you’re using on the command line? It may be that you are running the command in the wrong folder and this causes a problem to find the right package.
– user201641