vscode-java icon indicating copy to clipboard operation
vscode-java copied to clipboard

changing .classpath file reference

Open dss010101 opened this issue 2 years ago • 0 comments

I am working with a huge legacy application which was built using Ant + Eclipse. There exists a .classpath file already with references like this (which im guessing eclipses creates):

<classpathentry kind="var" path="LIB_ROOT/json/json.jar"/>
<classpathentry kind="var" path="LIB_ROOT/apache/commons-logging.jar"/>
<classpathentry kind="src" path="src/"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>

Out of the box this doesnt work in vscode as it has no idea wht LIB_ROOT is.

My thought then is since this is a giant ant project and would be quite an effort to convert to maven (cant do gradle as it's also a java 1.8 project), i could do one of the following:

  1. simply create an ant task to generate a new .classpath file, say .classpath_vscode
  2. or simply generate a line separated list for each libary, and possibly referecne this file as the list values for settings.json -> java.project.referencedLibraries

For #1, is it possible to tell the java extension to use a different .classpath file? (this way devs can move to vscode, but still also work in eclipse using the original .classpath file.

For #2 - would i be able to reference a separate file as the source for the list?

Thanks

dss010101 avatar Dec 15 '23 19:12 dss010101