Question:
how to Install, configure, and run a JAI program (Java advanced imaging API)?
Sudeepta
2008-09-23 10:47:07 UTC
i am new to JAI, trying to learn and program in it.
i downloaded jai 1.1 all the files(jdk,jre,lib) then i installed them one by one.
when i am trying to compile and run "Listing 1-1 Simple Example JAI Program" from
"http://java.sun.com/products/java-media/jai/forDevelopers/jai1_0_1guide-unc/Introduction.doc.html#47285"

It is not compiling and giving an error like:
---------------------------------------------------------------------------------------
AccessRGB.java:7: package javax.media.jai does not exist
import javax.media.jai.*;
^
AccessRGB.java:8: package javax.media.jai.widget does not exist
import javax.media.jai.widget.*;
^
AccessRGB.java:16: cannot find symbol
symbol : class PlanarImage
location: class AccessRGB
PlanarImage image1 = JAI.create("fileload",fileName)
^
AccessRGB.java:16: cannot find symbol
symbol : variable JAI
location: class AccessRGB
PlanarImage image1 = JAI.create("fileload",fileName)
^
AccessRGB.java:65: cannot find symbol
symbol : variable JAI
location: class AccessRGB
(RenderedImage)JAI.create("bandSelect", paramsR);
^
AccessRGB.java:67: cannot find symbol
symbol : variable JAI
location: class AccessRGB
(RenderedImage)JAI.create("bandSelect", paramsG);
^
AccessRGB.java:69: cannot find symbol
symbol : variable JAI
location: class AccessRGB
(RenderedImage)JAI.create("bandSelect", paramsB);
^
AccessRGB.java:72: cannot find symbol
symbol : variable JAI
location: class AccessRGB
JAI.create("filestore",imageR,"redBand.JPG");
^
AccessRGB.java:73: cannot find symbol
symbol : variable JAI
location: class AccessRGB
JAI.create("filestore",imageG,"greenBand.JPG");
^
AccessRGB.java:74: cannot find symbol
symbol : variable JAI
location: class AccessRGB
JAI.create("filestore",imageB,"blueBand.JPG");
^
AccessRGB.java:81: cannot find symbol
symbol : class PlanarImage
location: class AccessRGB
PlanarImage redBand = JAI.create("scale",params);
^
AccessRGB.java:81: cannot find symbol
symbol : variable JAI
location: class AccessRGB
PlanarImage redBand = JAI.create("scale",params);
^
AccessRGB.java:87: cannot find symbol
symbol : class ScrollingImagePanel
location: class AccessRGB
ScrollingImagePanel panel =
^
AccessRGB.java:88: cannot find symbol
symbol : class ScrollingImagePanel
location: class AccessRGB
new ScrollingImagePanel(redBand,widthR,heightR);
^
Note: AccessRGB.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
14 errors


-----------------------------------------------------------------------------------------
I think it is not taking the library path properly but i tried linking all the jai*.jar files in classpath but that did not work please help.

I have installed jdk1.6.0_07, jre1.6.0_07 path is set and i can compile and run the normal java programs properly.
i am using winxp machine.
Three answers:
mani m
2008-10-01 08:16:47 UTC
The thing is u have not installed the right library files for JAI thats why it is not running and giving this





AccessRGB.java:7: package javax.media.jai does not exist

import javax.media.jai.*;

^

AccessRGB.java:8: package javax.media.jai.widget does not exist

import javax.media.jai.widget.*;

...

sort of error.



u uninstall the jai packages which ever u have installed and do the following:



------------------------------------------

Click the binarybuilds(download page) link in https://jai.dev.java.net/

which will take you to

https://jai.dev.java.net/binary-builds.html



download the proper .exe files (the verson u need i have used 1.1.3 here) and install all the .exe files

as follows:



jai-1_1_3-lib-windows-i586-jre.exe

jai-1_1_3-lib-windows-i586-jdk.exe

jai-1_1_3-lib-windows-i586.exe



then set classpath as

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



and set path before system path as follows, if u have not given the path after installing java(dont delete the existing paths):

C:\Program Files\Java\jdk1.6.0_07\bin;C:\Program Files\Java\jre1.6.0_07\bin

--------------------------------------



then restart the computer, i hope this will solve the problem.
ira
2016-05-26 12:03:40 UTC
When you type java -version on the command line you are not getting the default version of java. You are getting the first version of the java program that the operating system finds from the list in the Path environment variable. Because this is the first version of the program, every program that runs a "Java" command will use this version of Java. If you are using another program like FireFox or Internet Explorer then they may be using a different version of java. I hope that helps.
2016-10-18 07:12:09 UTC
Javax.media.jai


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...