I made a project (Chess GUI game) that includes a few directories, in java. Here is the project tree:
├───images
│ black_bishop.png
│ black_king.png
│ black_knight.png
│ black_pawn.png
│ black_queen.png
│ black_rook.png
│ white_bishop.png
│ white_king.png
│ white_knight.png
│ white_pawn.png
│ white_queen.png
│ white_rook.png
│
└───source
├───GameGUI
│ ChessBoardPanel.java
│ ChessCellPanel.java
│ Game.java
│ PieceLabel.java
│
├───MainComponents
│ Board.java
│ Cell.java
│ Move.java
│ Piece.java
│
└───Pieces
Bishop.java
King.java
Knight.java
Pawn.java
Queen.java
Rook.java
When trying to compile the file with the main method, which is Game.java
, I go to the directory (in cmd using cd
), and use javac Game.java
.
But it doesn't compile and shows the following error:
source\GameGUI\Game.java:18: error: cannot find symbol
frame.add(new ChessBoardPanel());
^
symbol: class ChessBoardPanel
1 error
I suppose it's because I have to compile the ChessBoardPanel.java
file as well. But then I would have to compile all the files with the classes it's using, recursively.
I can do it by hand I guess, but my question is, is there a faster way? I just haven't tried to compile it and run manually since I was using vscode's extension to run it directly.
Im asking this because I want to upload it to GitHub and add instructions on how to run it without assuming that the viewer has vscode installed.