redhat-developer / vscode-java

Java Language Support for Visual Studio Code
Eclipse Public License 2.0
2.07k stars 430 forks source link

Removing the JRE System Library from Classpath #2084

Open rileyg98 opened 3 years ago

rileyg98 commented 3 years ago

I'm unable to find a way to remove the JRE System Library from the project classpath.

Eclipse has generally had the ability to remove the System Library from classpath.

Environment
Steps To Reproduce
  1. Open a project, and attempt to remove the JRE System Library.
  2. This is not possible.

A "sample" project is available at https://github.com/VivoKey/vk-u2f. The error itself is on loading CTAP2.java.

Current Result

Unable to remove JRE System Library

Expected Result

To be able to remove the JRE system library

Additional Informations

The requirement to remove JRE System Library is for programming in JavaCard, which does not use the standard Java libraries but provides it's own. I've been ignoring the issue for a while but have now found an error where using an Exception class throws build errors in VS Code (the other builds work as normal, as they don't use the system library) due to the JavaCard library also providing a java.lang.Exception.

jdneo commented 3 years ago

Currently there is no user interface to achieve that. But you can try to open the .classpath file, and then remove <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-XX">

bguedas commented 5 months ago

I've got the same issue when loading a MicroEJ project (which does not depend on JRE). We're using gradle, so it seems that there is no .classpath to edit.