Why doesn't Eclipse recognize the new JAR?

I got a new SOAP JAR partner from a teammate and am busy integrating it into my application. I put the JAR in the appropriate path, overwriting the previous version. I updated my workspace, performed Clean and Build, but ...

... I cannot see any of the classes in the JAR through intellisense, although the code I use from the JAR will compile and execute correctly. In addition, Eclipse is still trying to use the previous version of the JAR, because when I do the “import fixes”, it re-imports the old classes, not the new ones.

The code builds and runs, but I have to refer to classes absolutely, and not relatively:

 org.acmewidgets.soap.inputs.HeaderType header = new org.acmewidgets.soap.inputs.HeaderType()

Instead

 HeaderType header = new HeaderType()

The previous version of the JAR did not require this.

How to make Eclipse use old links and use new ones? Or, Eclipse runnin 'fine, and my new JAR is suspected?

Thank!

+3
source share
2 answers

Something seems to have broken forever. If closing and opening the project again does not help, try to do it as follows:

  • If your project depends on other projects from the workspace, you can get two JARs in the classpath. Run the tests or your application, then switch to the "Debug" perspective, select the project (which is completed), then select "Properties" in the context menu. This gives you the path to the class that was used.

    Copy this into a text editor and find the JAR file and make sure that you have only one copy in the classpath.

  • JAr. , , .

  • ( ) . ?

  • Eclipse (3.6.1)

+5

' .

0

Source: https://habr.com/ru/post/1784134/


All Articles