Vscode-java: The import javax.servlet cannot be resolved

Created on 5 May 2017  路  5Comments  路  Source: redhat-developer/vscode-java

[provide a description of the issue]

Environment
  • Operating System: win10
  • JDK version: 1.8.0_131
  • Visual Studio Code version: 1.12.1
  • Java extension version: 0.3.0

image

invalid

Most helpful comment

It's working for me:
$ cp /tomcathome/lib/servlet-api.jar /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/ext/

All 5 comments

Can you please provide more details, is this a standalone java file, a Maven, Gradle or plain eclipse project? Can you provide a sample project reproducing the issue?

Caused by: org.eclipse.core.internal.resources.ResourceException: Invalid project description.
at org.eclipse.core.internal.resources.Project.checkDescription(Project.java:169)
at org.eclipse.core.internal.resources.Project.assertCreateRequirements(Project.java:53)
at org.eclipse.core.internal.resources.Project.create(Project.java:263)
at org.eclipse.core.internal.resources.Project.create(Project.java:247)
at org.eclipse.jdt.ls.core.internal.managers.EclipseProjectImporter.importDir(EclipseProjectImporter.java:86)

it seem to have some problems for my project,and now it works well,thx.

It's working for me:
$ cp /tomcathome/lib/servlet-api.jar /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/ext/

I can't find the directory /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/ext/.
please tell me how to find this.

I can't find the directory /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/ext/.
please tell me how to find this.

Try:
java -verbose | grep 'Loaded java.lang.Shutdown from'
Output:
[Loaded java.lang.Shutdown from /usr/lib/jvm/java-8-openjdk/jre/lib/rt.jar]

The copy command will be:
$ cp ~/tomcathome/lib/servlet-api.jar /usr/lib/jvm/java-8-openjdk/jre/lib/ext/

Was this page helpful?
0 / 5 - 0 ratings