Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8633467
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T09:29:48+00:00 2026-06-12T09:29:48+00:00

I am trying to read a .tif image using javax.media.jai.JAI. Here is my code:

  • 0

I am trying to read a .tif image using javax.media.jai.JAI. Here is my code:

import javax.media.jai.JAI;
import javax.media.jai.RenderedOp;

BufferedImage image = null;
if(extension.toLowerCase().equals("tif")) {
    RenderedOp op = JAI.create(fileName, file);
    image = op.getAsBufferedImage();
} else {
    image = ImageIO.read(file);
}

The “file” (Java.io.File) and “fileName” (String) parameters are fine. But when it gets to the “JAI.create(…)” line, I get this exception:

java.lang.ClassNotFoundException: javax.media.jai.JAI

I’m not sure why it can’t find JAI. Any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T09:29:48+00:00Added an answer on June 12, 2026 at 9:29 am

    JAI doesn’t come with the JDK. You get it separately. Find the appropriate JAR library here. Then add that to your path.

    Note: If you are using Windows, you can get the jar and specify the path by yourself. Or get the exe which will install the same jar and add it to your system classpath. I would prefer to set the paths by myself.

    On Ubuntu, you can also install it via

    sudo apt-get install libjai-core-java
    

    Loading Image can be done like this:

    public BufferedImage loadImage(String filePath){
        RenderedOp img = JAI.create("fileload", filePath);
        return img.getAsBufferedImage();
    }
    

    "fileload", as a literal String, is the name of the operation to load an image from a file using JAI.create(). That could also throw an exception if fileName is not equal to "fileload".

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im trying to read in image file from a server , with the code
Trying to read an RSS and select information using Linq but can't seem to
I was trying to read a self-extracting zip (located here ftp://ftp.dnr.state.oh.us/OilGas/Download/Production/By_Year/2010Production.exe ) using java
I am trying to read some XML code from a website, and am having
I am trying to read from a file and encrypt the data using AES
I'm trying to convert multiple .tif files into .png files using Imagemagick on the
I am trying read rss feed of stack overflow using Linq to xml. I
am trying to read web page from java code and its fine for general
I'm trying to convert a bitmap image into an uncompressed tif file for use
I am trying to read in a scanned image and compress it from a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.