No "referenced libraries" in VS Code Java project

Viewed 3465

I imported a Java project into Code that was originally developed in Eclipse. At first, the entire "Java Projects" section in the explorer would not appear, but I did a "Clean Java language server workspace" and it appeared. However, "Referenced Libraries" does not appear:

enter image description here

I am not sure why this is the case. When I manually added the jars I wanted to the .classpath file, the "Referenced Libraries" appeared but said "Read-only." Further, doing a workspace clean removed these from the .classpath file, and the "Referenced Libraries" section disappeared again. Am I missing something? What can I do to get "Referenced Libraries" back?

1 Answers

I had this problem and solved it editing the .classpath file directly. After creating a "lib" directory aside "src" and "bin", I wrote a new line like this:

<classpathentry kind="lib" path="lib/yourlibrary.jar">

After that, I opened VScode and it recognized the referenced library.

Related