I am using Visual Studio Code to Write a Java Project. For that i want to use the MigLayout.jar in my Project.
I created a new Project so i would get a .classpath
I tried to follow the instructions here: https://stackoverflow.com/a/54535301/11654683
Here you can see my Classpath File
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-12"/>
<classpathentry kind="src" path="src/"/>
<classpathentry kind="output" path="bin"/>
<classpathentry exported="true" kind="lib" path="lib/miglayout.jar">
</classpath>
When I try to edit my class App.java it says: App.java isnt on the classpath Only Syntax errors will be reported.
This is the path of my java file: 11 - Test Project\Test Project\src\app\app.java
I do want to continue using VS Code and not change to a different Editor. How can I finally use my MigLayout.jar without getting these errors?
EDIT:
I created a lib folder next to an independent file and inserted the jar file I wanted to import. VS Code does now understand MigLayout as a type when I import
import net.miginfocom.layout.Grid; import net.miginfocom.swing.MigLayout;
But when compiling it says: .\Win.java:5: error: package net.miginfocom.layout does not exist import net.miginfocom.layout.Grid; ^ .\Win.java:6: error: package net.miginfocom.swing does not exist import net.miginfocom.swing.MigLayout;
As you can see i have referenced it in the browser: Structure