I know the title doesn't fully describe my problem, but I'm not sure how else to ask this. I know there's tools to do this, but I want to understand how the compiler works in java, I wrote some very basic code and I'm able to compile them without any problems using
javac -sourcepath java -d ../target/dir1 java/shapes/mainclass/TestRun.java
in the command line, but that only works when the packages are in the same source directory as seen in the picture below
I want to be able to compile from the command line where my package are in other source directories as well, please see the picture below
Does anyone know how I can do this ? I tried modifying the command line to
javac -sourcepath java -d ../target/ java/dir1/shapes/mainclass/TestRun.java but this results in the following error
java\dir1\shapes\mainclass\TestRun.java:3: error: package shapes.classes does not exist
import shapes.classes.*;
^
java\dir1\shapes\mainclass\TestRun.java:8: error: cannot find symbol
ShapeMain circle = new Circle(5);
^
symbol: class ShapeMain
location: class TestRun
java\dir1\shapes\mainclass\TestRun.java:8: error: cannot find symbol
ShapeMain circle = new Circle(5);
^
symbol: class Circle
location: class TestRun
java\dir1\shapes\mainclass\TestRun.java:9: error: cannot find symbol
ShapeMain rectangle = new Rectangle(8, 9.9);
^
symbol: class ShapeMain
location: class TestRun
java\dir1\shapes\mainclass\TestRun.java:9: error: cannot find symbol
ShapeMain rectangle = new Rectangle(8, 9.9);
^
symbol: class Rectangle
location: class TestRun
java\dir1\shapes\mainclass\TestRun.java:10: error: cannot find symbol
ShapeMain triangle = new Triangle(10, 4.5);
^
symbol: class ShapeMain
location: class TestRun
java\dir1\shapes\mainclass\TestRun.java:10: error: cannot find symbol
ShapeMain triangle = new Triangle(10, 4.5);
^
symbol: class Triangle
location: class TestRun
7 errors
Any help will be appreciated

