Import .jar in Visual Studio Code, classpath

后端 未结 2 1949
温柔的废话
温柔的废话 2021-01-15 00:29

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

2条回答
  •  南方客
    南方客 (楼主)
    2021-01-15 01:09

    I set up a gradle project and added the dependency via the link from https://mvnrepository.com/

    I copied the given commands on the MigLayout Site behind the "Gradle" tab and put them into the dependencies{} in the build.grade file

    With ./gradlew run from the command line out of the project folder it compiled successfully. Thanks for the help anyways.

    PS: I still haven't figured out how to do it without gradle. Even compiling from the command line with: javac -cp "path to jar" myFile i did not get the dependencies right. Let me know if you have experience with that.

提交回复
热议问题