Skip to main content

Beginner's question: Neccessary JARs? Where to find them?

8 replies [Last post]
andrekuhn
Offline
Joined: 2009-01-12
Points: 0

Hi there

I want to make use of this JAI stuff. (Need to convert a TIFF file to JPEG.)

I got hold of JMF2.1.1e and the libraries:
jmf.jar
customizer.jar
mediaplayer.jar
multiplayer.jar
sound.jar

I got hold of jai_imageio_windows-i586.jar which brought me:
jai_imageio.jar

And I was browsing all other Jars using a class dependency analyser. No result.

Nothing can make this sample code run:
RenderedOp src = JAI.create("fileload", inputFile);
FileOutputStream stream = new FileOutputStream(outputFile);
JAI.create("encode", src, stream, "tiff", null);
JAI.create("filestore", src, outputFile, "tiff", null);

JAI, RenderedOp and all that stuff won't be found. Any hints?

Many thanks!!!

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Ken Warner

You need ImageIO Tools for JAI. Separate download.

Only SUN knows why....

jai-imageio@javadesktop.org wrote:
> Hi there
>
> I want to make use of this JAI stuff. (Need to convert a TIFF file to JPEG.)
>
> I got hold of JMF2.1.1e and the libraries:
> [b]jmf.jar[/b]
> customizer.jar
> mediaplayer.jar
> multiplayer.jar
> sound.jar
>
> I got hold of jai_imageio_windows-i586.jar which brought me:
> [b]jai_imageio.jar[/b]
>
> And I was browsing all other Jars using a class dependency analyser. No result.
>
> Nothing can make this sample code run:
> RenderedOp src = JAI.create("fileload", inputFile);
> FileOutputStream stream = new FileOutputStream(outputFile);
> JAI.create("encode", src, stream, "tiff", null);
> JAI.create("filestore", src, outputFile, "tiff", null);
>
> JAI, RenderedOp and all that stuff won't be found. Any hints?
>
> Many thanks!!!
> [Message sent by forum member 'andrekuhn' (andrekuhn)]
>
> http://forums.java.net/jive/thread.jspa?messageID=325323
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
> For additional commands, e-mail: interest-help@jai-imageio.dev.java.net
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
For additional commands, e-mail: interest-help@jai-imageio.dev.java.net

andrekuhn
Offline
Joined: 2009-01-12
Points: 0

Postscript to my question: I'd finally like to add that the link https://jai.dev.java.net/ supplied by Daniele Romagnoli is way better compared to mine posted afterwards which points to version 1.1.2 while his points to the most current version.

Okay, maybe I can bug you with another issue. After being able to collect all neccessary libaries from the wide world of the internet, I now run into:

java.lang.NoClassDefFoundError: javax/media/jai/OperationRegistrySpi
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
...

This *might* connects to the fact, there is also a certain file missing called: registryFile.jai which wasn't supplied with the distribution. Any hints?

Boy, this *is* complicated. All I want to do is to convert a TIFF...

Many thanks!!

robert engels

You should probably start with some "intro to java" books, and read
about class loading, finding jars, etc.

Trying to use a development language to "do a task" without
understanding the language is going to problematic.

Java is not a "tool" for image conversion, it is a development platform.

For example, on a Mac, you don't need to load anything, it is all
there to begin with (i.e. the stuff needed to convert a Tiff using
Java).

On Jan 12, 2009, at 10:29 AM, jai-imageio@javadesktop.org wrote:

> Postscript to my question: I'd finally like to add that the link
> https://jai.dev.java.net/ supplied by Daniele Romagnoli is way
> better compared to mine posted afterwards which points to version
> 1.1.2 while his points to the most current version.
>
> Okay, maybe I can bug you with another issue. After being able to
> collect all neccessary libaries from the wide world of the
> internet, I now run into:
>
> java.lang.NoClassDefFoundError: javax/media/jai/OperationRegistrySpi
> at java.lang.ClassLoader.defineClass1(Native Method)
> at java.lang.ClassLoader.defineClass(Unknown Source)
> ...
>
> This *might* connects to the fact, there is also a certain file
> missing called: registryFile.jai which wasn't supplied with the
> distribution. Any hints?
>
> Boy, this *is* complicated. All I want to do is to convert a TIFF...
>
> Many thanks!!
> [Message sent by forum member 'andrekuhn' (andrekuhn)]
>
> http://forums.java.net/jive/thread.jspa?messageID=325359
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
> For additional commands, e-mail: interest-help@jai-
> imageio.dev.java.net
>

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
For additional commands, e-mail: interest-help@jai-imageio.dev.java.net

andrekuhn
Offline
Joined: 2009-01-12
Points: 0

Dear Robert. That was helpful. Thanks!

To the rest of you willing to help a newbie to JAI: Doesn't seem to be connected to the missing registryFile.jai, which isn't actually missing but put into META-INF of jai_core.jar since version 1.1. (Learned it here: http://archives.java.sun.com/cgi-bin/wa?A2=ind0107&L=JAI-INTEREST&P=R15276)

The NoClassDefFoundError of OperationRegistrySpi *seems* to be a nasty class linking (loading) issue. But this is a mere guess after reading a couple of forum threads elsewhere. So, I'd still greatly welcome hints here.

Many thanks!

Message was edited by: andrekuhn

marcojacob
Offline
Joined: 2006-07-10
Points: 0

Maybe you can give us some more information.

Which JDK do you use? How do you start the JVM?
What is your CLASSPATH?

Are jai_core.jar, jai_codec.jar and jai_imageio.jar in classpath?
Which version did you use?

andrekuhn
Offline
Joined: 2009-01-12
Points: 0

Okay, sorry for my late response to your request, Marco. (Busy with paper work, etc.)

I made it run, though I can't point to a specific step that solved it. So here is my overall setting:

- installed [b]jai-1_1_3-lib-windows-i586-jdk.exe[/b] into %JAVA_HOME%
- CLASSPATH inludes "%JAVA_HOME%\jre\lib\ext;"
- PATH includes DLLs "%JAVA_HOME%\jre\bin" as pointed out here http://www.nabble.com/RE%3A-RE%3A-Scan---save-in-TIFF-p21333884.html
- WEB-INF/lib extended by [b]jai_codec.jar, jai_core.jar, jai_imageio.jar[/b]

and the TIF to JPEG snippet above works perfectly as JUnit.

Alright, thanks for listening and you guys all have a good one

Daniele Romagnoli

Hi,
I guess you have simply downloaded JAI-ImageIO tools.
However, you also need JAI libraries: https://jai.dev.java.net/
(jai_core, jai_codec, ...)

Hope this helps.
Regards,
Daniele

On Mon, Jan 12, 2009 at 1:47 PM, wrote:

> Hi there
>
> I want to make use of this JAI stuff. (Need to convert a TIFF file to
> JPEG.)
>
> I got hold of JMF2.1.1e and the libraries:
> [b]jmf.jar[/b]
> customizer.jar
> mediaplayer.jar
> multiplayer.jar
> sound.jar
>
> I got hold of jai_imageio_windows-i586.jar which brought me:
> [b]jai_imageio.jar[/b]
>
> And I was browsing all other Jars using a class dependency analyser. No
> result.
>
> Nothing can make this sample code run:
> RenderedOp src = JAI.create("fileload", inputFile);
> FileOutputStream stream = new FileOutputStream(outputFile);
> JAI.create("encode", src, stream, "tiff", null);
> JAI.create("filestore", src, outputFile, "tiff", null);
>
> JAI, RenderedOp and all that stuff won't be found. Any hints?
>
> Many thanks!!!
> [Message sent by forum member 'andrekuhn' (andrekuhn)]
>
> http://forums.java.net/jive/thread.jspa?messageID=325323
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
> For additional commands, e-mail: interest-help@jai-imageio.dev.java.net
>
>

--
-------------------------------------------------------
Eng. Daniele Romagnoli
Software Engineer

GeoSolutions S.A.S.
Via Carignoni 51
55041 Camaiore (LU)
Italy

phone: +39 0584983027
fax: +39 0584983027
mob: +39 328 0559267

http://www.geo-solutions.it

-------------------------------------------------------
[att1.html]

andrekuhn
Offline
Joined: 2009-01-12
Points: 0

Thanks!

Yes, I found out simultanously.
Here is the link that worked for me:
http://java.sun.com/products/java-media/jai/downloads/download-1_1_2_01....