Error message when attempting to import Java library

As the title says. I was attempting to import java.util.random using “import java.util.random;” and got an error message:

Libraries must be installed in a folder named ‘libraries’ inside the sketchbook folder (see the Preferences window).
The package “java.util.random” does not exist. You might be missing a library.

any help would be greatly appreciated.

1 Like

It’s capital Random, not random: import java.util.Random;
Docs.Oracle.com/en/java/javase/11/docs/api/java.base/java/util/Random.html

However, Processing got its own “easier” random() function:
Processing.org/reference/random_.html

4 Likes

thank you so much! The code isn’t turning up any errors anymore. Your help is greatly appreciated.