Santiago Ramirez
Santiago Ramirez

Reputation: 39

Problem importing a library in java (VSCode)

Basically I have to do a program that focuse on reading and writing on a csv on java, since I can use external libraries I thought of adding OpenCSV but even after adding it to "Referenced Libraries" on vscode when I try to compile it it says that the package doesnt exist and I can find information of how to do it properly

enter image description here

enter image description here

Upvotes: 1

Views: 483

Answers (1)

Jens
Jens

Reputation: 69470

use javac -cp <path_to_jar>/<jarname> App.java to compile your java file. This will add the library to the compiler.

if you use javac from command line, the settings of VSCode will be ignored.

Upvotes: 1

Related Questions