In my java project I have three java classes: 1. App.java 2. UrlLibrary.java 3. MyIterator.java
Firstly, when the java files are in a default package then App.java has been compiling and running fine in both eclipse and cmd.
But, When I set the java files in a custom package it's running in eclipse fine but fails when I tried to compile it in cmd. The error I'm getting:-
Most probably, the error is occurring because I am using another class in the App.java class which I'm actually compiling through javac. AS the error refers:
UrlLibrary sportsurl= new UrlLibrary(sports);
But that should not be the problem since all the three java files are in the same package and it's running fine in eclipse. So, what could be the reason for this scenario?
My Folder Structure:
And my package: