I have been using an IDE but now, in order to prepare my 1Z0-803 exam, I need to run and compile from the command line. The problem is that I have multiple packages and I have tried to find the answer but nothing has worked so far.
So I have :
package com.oca.tutorial;
import com.oca.tutorial.planets.Earth;
import com.oca.tutorial.planets.Mars;
import com.oca.tutorial.planets.Venus;
public class GreetingUniverse {
public static void main(String[] args) {
System.out.println("greetings universe");
new Earth();
new Mars();
new Venus();
}
}
Venus class:
package com.oca.tutorial.planets;
public class Venus {
public Venus() {
System.out.println("Hello from Venus");
}
}
Mars class
package com.oca.tutorial.planets;
public class Mars {
public Mars (){
System.out.println("Hello from Mars");
}
}
And my Earth class
package com.oca.tutorial.planets;
public class Earth {
public Earth (){
System.out.println("Hello from earth");
}
}
Command Line + error

Expected output:
greetings universe
Hello from earth
Hello from Mars
Hello from Venus
Fiel Structure for planets :
C:\OCA\com\oca\tutorial\planets
Fiel Structure for main GreetingUniverse :
C:\OCA\GreetingUniverse
error message from command prompt:

OCAdirectory?