Required library cannot denote external folder

It appears the ORDER of referenced jars in an Eclipse User Library is important. Goto:

    Window > Preferences...

        ...and on the preferences tree...

    Java > Build Path > User Libraries

I don't quite know why this is the case, but here's the story:

I was getting some errors in SqlDeveloper that didn't appear to come from my code. SqlDeveloper would open fine, but exceptions were being emitted to the console that didn't originate from any of my code.

As an experiment, I thought I would 'manually' remove all the SqlDeveloper extensions by cutting and pasting them to another folder. If the problems went away I should be able to determine which extension might be causing the issue.

When I removed the extensions, I soon realized my code wouldn't build because there were external references to the extensions I just deleted. One of these references was to oracle.sqldevelopr.searchbar.jar.

I put the extensions back and tried a different approach. I thought I would just remove the reference to searchbar.jar to see what parts of the code broke. I would then simply add the reference back to get back to normal.

This is when I got the mystifying error:

    'Required library cannot denote external folder'

I couldn't understand why simply adding back the reference caused so many problems. On a whim, I selected the jar and moved it down to the bottom of the list. When I selected 'OK' the projects recompiled successfully.

It doesn't entirely make sense that these external jar files in an arbitrary User Library would need to be in a certain order but this approach - moving the jar file to the end of the list - did fix the issue.

EclipseUserLibraryA EclipseUserLibraryB

Update:

This happened again, but for a different reason. I was removing some extensions from the ...\sqldeveloper\extensions folder and accidentally deleted one of the oracle.sqldeveloper.*.jar files by mistake. I got the deleted file from a co-worker, copied the file back where it was supposed to be, and everything was back to normal.

Essentially, if the scenario above doesn't work... make sure you're not just missing the .jar file in the first place!

5/6/2008 | Comments (0) in Eclipse | Java
Email

Related posts