wood burning stoves 2.0*
The moose likes Other JSE/JEE APIs and the fly likes Netbeans IDE and JAI Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "Netbeans IDE and JAI" Watch "Netbeans IDE and JAI" New topic

Netbeans IDE and JAI

Dasha Gilmore

Joined: Feb 22, 2013
Posts: 5
I am trying to install JAI into Netbeans IDE 7.12 on a 64 bit Windows 7 system and don't seem to be getting it done correctly. I am new to Java, so this may be part of the problem. Here's what I have done so far:

[1] I downloaded the JAI executable files:
o jai-1_1_3-lib-windows-i586.exe
o jai-1_1_3-lib-windows-i586-jre.exe
o jai-1_1_3-lib-windows-i586-jdk.exe

[2] Double-clicked on the jai-1_1_3-lib-windows-i586.exe. Thru the doc say it would install at

C:\Program Files\Sun Microsystems\Java Advanced Imaging 1.1.3

it installed at c:\jai_1_1_2_01

[3] Double-clicked on the jai-1_1_3-lib-windows-i586-jre.exe and it installed at

c:\Program Files (x86)\Java\jre7

[4] It was unclear whether JRE was needed, but I double-clicked on the jai-1_1_3-lib-windows-i586-jdk.exe and it said

This program requires the installation of Java 2 SDK version 1.3 Aborting Setup

[5] I went into Netbeans and under libraries added the paths:

c:\Program Files (x86)\Java\jre7\bin

(JDK 1.7 was already there as a default)

[6] I then looked at my code:

import javax.media.jai.NullOpImage;
import javax.media.jai.OpImage;
import com.sun.media.jai.codec.SeekableStream;
import com.sun.media.jai.codec.FileSeekableStream;
import com.sun.media.jai.codec.TIFFDecodeParam;
import com.sun.media.jai.codec.ImageDecoder;
import com.sun.media.jai.codec.ImageCodec;

and it says for all these imports that "Package javax.media.jai does not exist".

Any insights? Perhaps my libraries are wrong or I need to download something else?

Ulf Dittmer

Joined: Mar 22, 2005
Posts: 41634

[5] I went into Netbeans and under libraries added the paths:

c:\Program Files (x86)\Java\jre7\bin

This step I think is where the problem is. Firstly, you shouldn't be adding anything from the JRE or JDK. There is stuff in there to go into the PATH (where executables reside), but what you're dealing with here is the CLASSPATH (where Java libraries reside). Secondly, while I'm not sure how JAI organizes its classes (or how NetBeans expects them to be added), I'm guessing that you need to add the actual jar files that make up JAI, however many there may be - and not the directories in which these jar files reside.

Ping & DNS - my free Android networking tools app
Dasha Gilmore

Joined: Feb 22, 2013
Posts: 5
Thanks for the insights Ulf.

I made the changes, but still can't get JAI running. I then uninstalled the x64 version of IDE and installed the x86 version in hopes being all x86 would make a differnence, but it hasn't.

Perhaps JAI is overkill. All I really wnat to do is read in a TIFF image. I'd prefer to do it in x64 IDE so I can make use of more memory. Is there a better way to read TIFF that using JAI?

I agree. Here's the link: http://aspose.com/file-tools
subject: Netbeans IDE and JAI