Skip to content
Advertisement

Eclipse not able to see javax package

I’m currently trying to fiddle with images, specifically convert images from JPEG, WEBP, and BMP forms to PNG forms and my method uses the javax.imageio.ImageIO class. When I tried importing it, Eclipse yelled that the package that the type was not accessible. I thought that was weird and went digging through StackOverflow on my own and found multiple answers saying I should remove and re-add the JRE. This didn’t work, somewhat unsurprisingly, but while looking through my build path I noticed that the JRE was missing the entire javax package. Is there a reason this could be? Is there a fix?

The exact error reads The type javax.imageio.ImageIO is not accessible and the suggested edits ask me if I want to make class ImageIO in package javax.imageio.

I am using the latest build of Eclipse. My JDK is java-16-openjdk-amd64. I am running Ubuntu 20.04. I built this app from the ground up, so I am not using Maven (unless Eclipse uses Maven by default).

I tried compiling a basic class in my command line and it worked for some reason, despite not working in Eclipse.

I would rather not revert my JDK to an older version if I don’t have to.

Advertisement

Answer

It turns out I was being just being an idiot. It turns out I had actually made this with a module without realizing it. All it took for me was to get rid of the module file.

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement