My code like this
//package com.web_tomorrow;
public class RunThis1 {
public static void main(String[] args) {
System.out.println("Run ....RunThis1");
}
}
When I run javac command with "package com.web_tomorrow" package name commented or not commented in both cases it can compile well. But When I run java command with "package com.web_tomorrow" package name, I mean not commented, it shows the Error: Could not find or load main class RunThis1 And if I comment/ remove the package name and then run the java command it executes.
Could anyone plz explain why java cant find RunThis1.class file while javac can find RunThis1.java from the same folder which is web_tomorrow ?
C:\JavaPractices\CPTest\src\com\web_tomorrow>java RunThis1 Error: Could not find or load main class RunThis1
C:\JavaPractices\CPTest\src\com\web_tomorrow>javac RunThis1.java
C:\JavaPractices\CPTest\src\com\web_tomorrow>java RunThis1 Run ....RunThis1
How java command is related to package name ? How package name is affecting java to find main class ?
My Envr variable classpath value is .