My problem is the following: I am sort of new to programming and I wanted to include the guava.jar file I found on the internet (to use the ImmutableList.copyof()-method). I also have additional packages that I want to include (I wrote a few classes that handles stuff that's relevant for the project). I implemented the following structure: Location of the Main-Method that imports the AdditionalClass:
src/com/chess/engine/Main.java
The location of the AdditionalClass-method that imports the guava-jar :
src/com/chess/engine/board/MyAdditionalClass.java
If I compile my project from the "src"-directory via javac -cp com/guava.jar com/chess/engine/Main.java
and I get the following error-message:
com/chess/engine/Main.java:3: error: package com.chess.engine.board does not exist
import com.chess.engine.board.*;
^
I think that the problem is that I set the classpath to the guava.jar file and that's why the compiler suddenly doesn't find the AdditionalClass
anymore, but I don't know how to change.
If I don't include (...) -cd com/guava.jar (...)
and compile by using java com/chess/engine/Main.java
the AdditionalClass
will be recognized by the compiler but I get a bunch of new errors because the compiler can't find the guava.jar and therefore has no idea what to do with the "ImmutableList.copyOf()"
method I implemented.