|[CLOSED]classes in jar files not accessible [message #1837160]
||Sat, 23 January 2021 03:48
| Jim Anderson
Registered: October 2014
This is bewildering to me. I have set up Eclipse projects many times and importing classes in jar files has never been a problem for me. I have looked at a number of possibilities, but the error condition persists. I have run out of ideas and I'm looking for help.|
I have installed the Eclipse IDE for Java Developers, Version 2020-12 (4.18.0). I added a new project. As I typically do, I symbolically linked the src directory to my src directory on my development PC.
In the Package Explorer, I navigate to the source file I am working on. I double click and the source file is displayed in a editing window in Eclipse. Several of the import statements have errors because the jar files have not been added to the project.
Next, I point to my project in the Package Explorer and right click and select Properties and the Properties window for the project pops up. In the left column of the window, I select "Java Build Path" and then the "Libraries" tab for the Java Build Path. I click on "Classpath" and then I click on the "Add External JARS ..." button. I then navigate and click on the "jsoup-1.12.1.jar". I then add the "org.json.jar" external jar. In the library tab, I can see both of these jar files in the Classpath section. Then I click on the "Apply and Close" button.
In the Package Explorer, I can look at the "Referenced Libraries" under my project and both of jsoup and org.json jar files are displayed.
In the Package Explorer, I then right click on my project and select "refresh" to update my project.
These steps are a procedure I have done many times before with little trouble and when I have had trouble it was because I forgot a step or made a foolish mistake. Normally, I figure it out and then run my program.
But this time, after running through this procedure, my import statement shows an error message:
The type org.jsoup.Jsoup is not accessible.
and I have 5 other import statements with a similar message.
I am running on a Linux PC. When I check the eclipse job running on the PC, it is being run with my login id (jja). The paths to all the files in the project and the path to the jar files all lead to directories and files owned by me and with read/write permissions set properly. They should be accessible to the eclipse program that is running.
So, the jar files are seen by eclipse and they should be readable and accessible.
I think I'm doing everything correctly, but obviously, I am not. I feel like there is an obvious mistake, but I have been searching the internet and experimenting with this for hours and have made no progress.
It is getting late here, and I will pick up on this again in the morning. Suggestions are most welcome!!
[Updated on: Fri, 29 January 2021 18:08]
Report message to a moderator
Powered by FUDForum
. Page generated in 0.02171 seconds