0

I am taking the course titled Computer Science: Programming with a purpose. The course instructs us to use the stdlib.jar that they have provided for the same. I have followed the instructions to add the .jar file to the list of dependencies in the project structure. I am using the IntelliJ IDE.

When I use the import StdOut statement, it says Class 'StdOut' is in the default package. When I try using StdOut.printf("Hello World");, I get the error that says Cannot resolve symbol 'StdOut'.

What should I do?

don_Gunner94
  • 144
  • 11

1 Answers1

1

I think this could be useful What's the syntax to import a class in a default package in Java?

Anyway, if I got it correctly, you have to add it to the java path

Getting started. To use this class, you must have StdOut.class in your Java classpath. If you used our autoinstaller, you should be all set. Otherwise, either download stdlib.jar and add to your Java classpath or download StdOut.java and put a copy in your working directory.

Marco Medri
  • 176
  • 3
  • 1
    ? Any library will need to be in your classpath to use it. The answers linked clearly state your code needs to be in the default package. (That or use reflection.) – Tom Hawtin - tackline Apr 10 '20 at 16:55