Welcome to the CSC Q&A, on our server named in honor of Ada Lovelace. Write great code! Get help and give help!
It is our choices... that show what we truly are, far more than our abilities.

Categories

+14 votes
asked in CSC 305 Fall 2024 by (4.1k points)

1 Answer

+4 votes

First, add the dependency to pom.xml:

<dependencies>
<dependency>
    <groupId>com.google.guava</groupId>
    <artifactId>guava</artifactId>
    <version>31.1-jre</version>
</dependency>

Then update module-info.java: Add the module name of the library

module com.example.myproject {
requires com.google.common;

}

then build the project: Run Maven to compile and resolve dependencies:

mvn clean package
answered by (4.4k points)
...