Runnable Jar (using JAI) works on macs but not windows (java.NoClassDefFoundError)

Giizjetng

New Member
I am new to Java and this is my first time asking a question on stackoverflow. Please excuse me if any of this is naive or I'm not keeping to standards properly. I wrote a standalone application that uses the JAI API. This runs just fine on the mac and linux machines that I wrote it on.I use the IDE Eclipse. On the mac machine, I exported my java project as a jar and as a runnable jar. I made sure to include all the required libraries or source files where it was relevant.This exported runnable jar file works fine on another mac machine that does not have JAI installed, so I believe, based on that it must mean that I have done something right.When I run it on a windows machine, however, it gives this error:exception in thread awt-eventqueue-0 java.NoClassDefFoundError: com/sun/media/jai/codec/SeekableStreamThis cmd terminal does not allow highlighting or copy of the ouput of the jar file as far as I can tell. I can take a screen shot though [ouput from the program]I don't mind uploading the jar file if that is possible, it seems that it's not.Basically, I think you can see in the cmd window that this jar file is running correctly (I mean I can tell that from the output) up until the point that it is trying to call the JAI library. So it definitely has something to do with that.I suppose it must be that the JAI-less mac actually had it installed, or that there is some packaging of dependencies that's mac specific.My java version:[java version]I have tried to install JAI on this windows machine for a few hours now. I cannot get the JAI libraries to install such that they are recognized and accessible in the jdk or jre folders and in Eclipse. Windows installations for JAI are all through streamlined exe install processes that do not really give you many options or any clue about how to go and do things manually if the automatic install is not working. I can tell that JAI is not getting installed in the jdk or the jre folders, but it does install into a ''Program Files (x86)/Sun Microsystems/Java Advanced Imaging 1.1.3'' folder (I tried all four ways to install). I see people writing about setting the 'classpath' to find these files in reference to the linux and unix instructions, but I don't see anyone explain this for the windows installation. I don't know what to do, but anyways, that's a separate problem that I can't install JAI on this windows machine.If I can make a 'standalone' application with Java, then I should be able to write it and export it on one machine and then run it on a different machine as long as the other machine is running a compatible jre, right? Or do you need to have JAI installed on any machine that you want to run a program on that was developed with the JAI library? That would seem like it defeats the purpose of 'exporting a runnable jar'.I see in this tag on the right on the text bar that I'm not allowed to post images because I don't have a high enough reputation. I don't think it's really necessary to show them anyways. The error is as described above. The Windows machine is running 1.7 and the mac that exported the jar file is running 1.6 java.Thanks for your help.
 
Back
Top