-
Notifications
You must be signed in to change notification settings - Fork 339
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add libraries to single file without a project #194
Comments
@clankill3r thanks for asking. @testforstephen please help the user on this issue. |
For single file, the 3-party library is not supported now(the package name isn't supported also), we can vote for the feature like simple-project without .classpath and .project with predefined folder structure, │ project.json/project.yaml --human readable configuration for project name, jdk version, etc │ ├───lib -- folder for 3-party library │ a.jar │ └───src ├───main │ └───java │ └───com │ └───ms │ └───samples │ App.java │ └───test └───java └───com └───ms └───samples AppTest.java |
@clankill3r u can add config in launch.json like below: |
@simahao will add this feature at java-dependency in future, see it at https://marketplace.visualstudio.com/items?itemName=vscjava.vscode-java-dependency |
I did it in the launch.json archive as mentioned before, but it doesn't really work for me. I'd really want to know "how can I provide a jar files to a single file that is not a project"?... Well i just wanted to add a "mysql-driver.jar" archive to a single source code file (just for write some basic querys in jdbc using Visual Studio Code) |
I also have this installed, but i don´t know how can i supposed to add the .jar library with this extension. |
I searched in a lot of places for how to import .jar files in VSCode, and did not have much success. It seems VSCode prefers to use a project build file (Maven, Gradle) to read dependencies. However, there's a new feature where you put .jar files in a lib folder and it works. redhat-developer/vscode-java#384 microsoft/vscode-java-debug#194 redhat-developer/vscode-java#501 eclipse-jdtls/eclipse.jdt.ls#927
How can I provide a jar files to a single file that is not a project (like maven / eclipse /graddle)?
I tried:
and:
But that does not work.
Also I would prefer a way that intelliSense works, so that was heading the wrong way anyway.
I also tried a .classpath file in the root (this would be a nice way to have it working):
Hope this is possible or would be possible in the future.
I'm really looking for a way where I don't have to use maven or eclipse or whatever to set up a simple java project.
java version "1.8.0_144"
Java(TM) SE Runtime Environment (build 1.8.0_144-b01)
Environment
The text was updated successfully, but these errors were encountered: