Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Unable to use external jar files with Eclipse 2022-12(Unable to use external jar files with Eclipse 2022-12)
Unable to use external jar files with Eclipse 2022-12 [message #1857430] Tue, 07 February 2023 12:18 Go to next message
C Parmar is currently offline C ParmarFriend
Messages: 2
Registered: February 2023
Junior Member
I have recently installed Eclipse IDE 2022-12 on my laptop (Version: 2022-12 (4.26.0) Build id: 20221201-1913)
I am trying to run basic java program to load excel file using org.apache.poi libraries. However, eclipse is unable to access the imported library classes (org.apache.poi.xssf.usermodel.XSSFColor) even though the related jar files were added to classpath (java build path->libraries).
Tried with another jar httpclient jar file and noted same behavior, eclipse unable to access class file (org.apache.commons.math3.optim.nonlinear.scalar.gradient.*)

For httpclient ctrl+space shows the org.apache.commons.math3.optim.nonlinear.scalar.gradient class but still getting not accessible error. Any suggestion what could be wrong? (related screenshot attached)
  • Attachment: eclipse1.jpg
    (Size: 558.49KB, Downloaded 438 times)
  • Attachment: eclipse2.jpg
    (Size: 152.08KB, Downloaded 319 times)
  • Attachment: eclipse4.jpg
    (Size: 360.91KB, Downloaded 308 times)
Re: Unable to use external jar files with Eclipse 2022-12 [message #1857443 is a reply to message #1857430] Wed, 08 February 2023 05:30 Go to previous messageGo to next message
Eitan Rosenberg is currently offline Eitan RosenbergFriend
Messages: 143
Registered: October 2018
Senior Member
Hi there,

You use module-info.java.

So you have to add the required modules names to it.

Actually, If you look, eclipse is telling you so right here:

index.php/fa/42898/0/

Regards.
Re: Unable to use external jar files with Eclipse 2022-12 [message #1857453 is a reply to message #1857443] Wed, 08 February 2023 13:35 Go to previous messageGo to next message
Eitan Rosenberg is currently offline Eitan RosenbergFriend
Messages: 143
Registered: October 2018
Senior Member
Hi again,
If you do not plan to create a module, you can also delete module-info.java.
Regards
Re: Unable to use external jar files with Eclipse 2022-12 [message #1857481 is a reply to message #1857453] Thu, 09 February 2023 17:52 Go to previous messageGo to next message
C Parmar is currently offline C ParmarFriend
Messages: 2
Registered: February 2023
Junior Member
Hi Eitan,
Thank you so much for the guidance here. I am using eclipse after gap of few years. The module-info Java file was auto created when I created a new project. I believe this was not case when I worked on some older versions of eclipse. I did note this file but was not aware of its functionality or if it could cause the import issue. Thank you for pointing it out and saving me lot of time and energy.
I deleted module-info java file and the import issues got resolved automatically.

Thanks & Regards,
Chintan
Re: Unable to use external jar files with Eclipse 2022-12 [message #1857482 is a reply to message #1857481] Thu, 09 February 2023 18:17 Go to previous messageGo to next message
Eitan Rosenberg is currently offline Eitan RosenbergFriend
Messages: 143
Registered: October 2018
Senior Member
Hi,

You are welcome.

I just checked, and the creation of module-info.java is checked by default:

index.php/fa/42903/0/

I use maven projects, so module-info.java is not created automatically.
If I need one, I configure the project.

Regards.
Re: Unable to use external jar files with Eclipse 2022-12 [message #1857786 is a reply to message #1857430] Sat, 25 February 2023 18:59 Go to previous message
Androe roy is currently offline Androe royFriend
Messages: 1
Registered: February 2023
Junior Member
Good Information
Make sure that the jar file is included in your project's build path. To do this, right-click on your project in the Project Explorer, select "Properties", then "Java Build Path", and click on the "Libraries" tab. From there, you can add the jar file to your project's classpath.

Check that the jar file is in the correct location. Eclipse expects jar files to be located in the project's "lib" folder by default. If the jar file is not in the correct location, you may need to move it or update your project's build path to point to the correct location. Best Regards

Check that the jar file is not corrupt or incompatible with your project. Try opening the jar file with a tool like 7-Zip or WinRAR to make sure that it contains the files you expect. You may also want to check the documentation or release notes for the jar file to make sure that it is compatible with your project.
Previous Topic:Source Look up
Next Topic:Unable to dock windows Eclipse 2019-09R + MACOS BigSur
Goto Forum:
  


Current Time: Fri Apr 26 16:17:14 GMT 2024

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

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

Back to the top