Notifications
Clear all

[Solved] Eclipse/Studio - Import cannot be resolved / classpath jars are missing

3 Posts
3 Users
0 Reactions
5,079 Views
0
Topic starter

I observed the some imports have errors in eclipse saying the import cannot be resolved. This happens especially for classes from 3rd party jars.

When going to Project -> BuildPath -> Libraries tab, jar files are showing an error (missing).

Greg Merrill 2024-08-27 21:40:10

@scoopman Can you attach a screenshot of the errors please

1 Answer
0
Topic starter

The problem is that some projects are not imported, especially install-staging.

Since Neo 3.10 many jars are moved from third-party to install-staging\build\deps. Previously, I had only needed to import a subset of modules to resolve most of the refs that are used by my module. I did not have install-staging imported. Check what the folder path segment starts with in the Build path UI, and see if there is a Project matching that name you can import.

After importing install-staging and refreshing my project, the classpath jars no longer give an error. Syntax highlighting and method suggestions work properly.

 

Also note:

In the .classpath entries, the paths have a leading slash like "/install-staging/build/deps/web-inf-lib/poi.jar" A leading slash indicates a reference to another project relative to the workspace. So this will fail if the project is not imported.

Initially I thought the classpath entry may be incorrect because I wasnt aware of the meaning of the leading slash. In the web module I tried changing the classpath entry to this to match the structure on the file system: "../install-staging/build/deps/web-inf-lib/poi.jar". This works, but its probably less ideal because it would break if you change the level of nesting of projects in the file system. Anyways, it just isn't how PLT does it. Importing the correct projects should be done.

This post was modified 4 months ago by scoopman
Marco Gouveia 2024-08-28 07:33:23

@scoopman Make sure you also imported the install-staging project, otherwise these 3p jars will not be accessible in studio