Skip to main content



      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 07:18 Go to next message
Eclipse UserFriend
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 747 times)
  • Attachment: eclipse2.jpg
    (Size: 152.08KB, Downloaded 603 times)
  • Attachment: eclipse4.jpg
    (Size: 360.91KB, Downloaded 524 times)
Re: Unable to use external jar files with Eclipse 2022-12 [message #1857443 is a reply to message #1857430] Wed, 08 February 2023 00:30 Go to previous messageGo to next message
Eclipse UserFriend
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 08:35 Go to previous messageGo to next message
Eclipse UserFriend
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 12:52 Go to previous messageGo to next message
Eclipse UserFriend
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 13:17 Go to previous messageGo to next message
Eclipse UserFriend
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 13:59 Go to previous message
Eclipse UserFriend
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: Sun Jul 13 00:05:42 EDT 2025

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

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

Back to the top