Where do I put libraries (jars) if I want to use them in my class?
See original GitHub issueThe only way I managed to make LSP give me autocomplete options for .jars is when I put them inside /workspace/jdt.ls-java-project/lib folder and manually changing /workspace/jdt.ls-java-project/.classpath file to:
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="output" path="bin"/>
<classpathentry exported="true" kind="lib" path="lib/selenium-api-3.141.59.jar"/>
</classpath>
The problem with this is that the LSP eventually overwrites .classpath file and won’t give me library autocompletion anymore until I manually add it in again. Where do I put my .java and .class files in order for LSP to include them in my editor so I get autocompletion for imports, classes, etc.?
I am using Monaco Editor with monaco-languageclient and custom websocket server that starts an eclipse-jdt-ls.jar and redirects jsonrpc commands to it. Can there somehow be a problem with my configuration?
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:18 (9 by maintainers)
Top Results From Across the Web
How to Add Libraries to a JAR - Java Basics - GitHub Pages
Solution 1: Using the Class-Path Attribute · Solution 2: Unpack Library JARs into a Single JAR · Solution 3: Call java with all...
Read more >Where to put the external jars? [duplicate] - Stack Overflow
If you're wanting to include a JAR file to your Eclipse project, you would generally create a 'lib' folder inside the project folder, ......
Read more >Adding a JAR file or class folder to a Java XOM - IBM
Click Java Execution Object Model in the list of properties. Click the Libraries tab to display the Libraries page so that you can...
Read more >Adding Classes to the JAR File's Classpath
We want to load classes in MyUtils.jar into the class path for use in MyJar.jar. These two JAR files are in the same...
Read more >Defining and using Java libraries via JAR files - Tutorial
A JAR can contain Java classes and other resources (icons, property files, etc.) and can be executable. You can distribute your program in...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I’m sorry but I lost it. I used Java to complete a course so I didn’t care about a reliable solution. Eventually I had a folder
jdt.ls-java-projectin the root of a project, the folder has such .classpath. I remember that later I copied the file from project to project. @rubencaroI had some experiments on the launch command but I can’t remember why I comment them out.
Hope it helps
Closing since the issue seems been resolved.
@ANtlord Free to comment if you need more help.