Skip to main content



      Home
Home » Newcomers » Newcomers » Can't get classes in Referenced Libraries recognized.(I have 2 external jars and I have checked them; the contain the classes that I want to import and use, but for some reason the eclipse editor still has my references underlined in red.)
Can't get classes in Referenced Libraries recognized. [message #1692236] Tue, 14 April 2015 08:44 Go to next message
Eclipse UserFriend
I have 2 external jars and I have checked them; the contain the classes that I want to import and use, but for some reason the eclipse editor still has my references underlined in red. What am I doing wrong?
Re: Can't get classes in Referenced Libraries recognized. [message #1692271 is a reply to message #1692236] Tue, 14 April 2015 12:48 Go to previous messageGo to next message
Eclipse UserFriend
More details are needed to help.
Re: Can't get classes in Referenced Libraries recognized. [message #1692386 is a reply to message #1692271] Wed, 15 April 2015 08:25 Go to previous messageGo to next message
Eclipse UserFriend
What details do you need?
Re: Can't get classes in Referenced Libraries recognized. [message #1692403 is a reply to message #1692386] Wed, 15 April 2015 09:28 Go to previous messageGo to next message
Eclipse UserFriend
On 04/15/2015 06:25 AM, Earl Hodil wrote:
> What details do you need?

Explain what you mean by "I have checked them". Do you mean that you've
used Build Path to integrate them into your project?

Incidentally, you'll likely be sorry to have integrated them using the
Build Path -> Libraries -> Add External JARs button. This puts
computer-specific paths into the .classpath file. Sharing your project
with someone else (committing it to a version-control system, etc.) will
be a disaster. Always integrate your libraries (JAR) dependencies using
Maven, Ivy, Gradle or, if not using those, make a lib subdirectory in
your project, move copies of the JARs there, then integrate using Build
Path -> Libraries -> Add JARs.

This may give you enough information to proceed or, I hope, enough
information to see what Eric's asking about in your project.

Cheers
Re: Can't get classes in Referenced Libraries recognized. [message #1692442 is a reply to message #1692403] Wed, 15 April 2015 13:35 Go to previous messageGo to next message
Eclipse UserFriend
Thanks, that told me what I needed to know.
Re: Can't get classes in Referenced Libraries recognized. [message #1829079 is a reply to message #1692442] Wed, 24 June 2020 16:11 Go to previous messageGo to next message
Eclipse UserFriend
Is it fixed with adding jar files under lib directory and referencing it again. I too tried the same, but it doesn't work for me.

Can anyone help me pls ?
Re: Can't get classes in Referenced Libraries recognized. [message #1829080 is a reply to message #1829079] Wed, 24 June 2020 16:16 Go to previous messageGo to next message
Eclipse UserFriend
Are the classes in the jar matched, from the top level, with the directory structure in the jar? e.g. com.example.MyClass would need to be in com/example/MyClass.class with the "com" directory being at the top level of the jar, not contained in something else.
Re: Can't get classes in Referenced Libraries recognized. [message #1832323 is a reply to message #1692403] Wed, 16 September 2020 06:44 Go to previous message
Eclipse UserFriend
No luck yet.

I created a sub-folder 'lib' underneath the project folder and copied the external JAR files in there ( related to JSON ). Still getting an error "The type org.json.JSONArray is not accessible" with the red cross mark in Eclipse IDE. This is after adding the JAR files via 'Build Path -> Configure Build Path -> Libraries -> classpath -> External JAR files...". Screenshot attached herewith.

I will attempt to created a Maven project in the meanwhile.

Any support to resolve this issue will be much appreciated.

Thanks!
Previous Topic:Unable to update Eclipse Plugin
Next Topic:eclipse打不开
Goto Forum:
  


Current Time: Wed Jul 23 13:42:28 EDT 2025

Powered by FUDForum. Page generated in 0.70266 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top