简体   繁体   中英

No "referenced libraries" in VS Code Java project

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:

在此处输入图像描述

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?

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.

Remove.classpath and.project files from the project folder. Then put your referenced library (for ex. jar file) file into lib folder. After you restart vscode it will be fixed.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM