Issue
I have a project that have been worked on eclipse by my coworker, they have it on git and have the .classpath
and .project
files on the repository.
I usually use Visual Studio Code and i wanted to use it for the java project as well.
The problem is that the .classpath
contains classpathentrys that have been configured with the eclipse Java Build Path and contains all the external Jars
that we need and also the JRE
.
The thing is that the JRE
is found without any problem in org.eclipse.jdt.launching.JRE_CONTAINER, but all the other org.eclipse.jdt.USER_LIBRARY can't be found.
The .classpath
also contains a output path that uses the Linked ressources of eclipse and can't be find as well.
Is there a way to tell VS Code what each classpathentry path actually is? a sort of override ?
I know that we can specify the java.project.referencedLibraries
in the settings.json
and I did that but if i keep the .classpath
the referencedLibraries are ignored on my project.
Even if i delete the .classpath
and .project
files VS Code seem to fail to recognize that it is a java project, so I'm a bit stuck here.
Any help would be appreciated, don't hesitate to ask for more informations if needed
Thanks in advance !
Solution
I finally found a way to make this work !
The way i did it was renaming the .classpath and .project files so that the project is "unmanaged". Then vscode tell me that it's not a java project anymore, so i added the sourcepaths in settings.json like this :
"java.project.sourcePaths":["."]
and then added all the libraries in "java.project.referencedLibraries" in settings.json, i waited for all of the libs to import and then it works !
I used the git update-index --assume-unchanged for both .project and .classpath so that i don't delete it for my coworkers and kept the files in case i need to open it in eclipse again.
Answered By - Anthony D
Answer Checked By - Willingham (JavaFixing Volunteer)