Re: NoClassDefFoundError
Roy Collins <[email protected]>
| Newsgroups | gmane.comp.windows.devel.jawin |
|---|---|
| Message-ID | <000e01c53027$af7e8790$6702a8c0@royworld> |
That did the trick. I needed the .jar in the classpath. I just had the directory not that acutal file listed. Now I get an error saying org.jawin.COMException: 800401f3: Invalid class string This happens when it tries to declare the methods that were created from the Typebrowser file. If anyone knows what this is from that would be helpful. I will play around with it tomorrow since I do not have time today. I feel guilty asking questions that I have not really looked into myself yet. Thanks for the help so far Christophe and Morton. You guys have gotten me a lot further along. ----- Original Message ----- From: "Morten Andersen" <[email protected]> To: <[email protected]> Sent: Wednesday, March 23, 2005 1:57 AM Subject: Re: [JAWIN] NoClassDefFoundError > Hi Roy and Christophe > > Hopefully I can clear things up a bit. There are two things you need to > use Jawin: > > 1) The native code: jawin/bin/jawin.dll (it seems this is the one Roy is > talking about). > > 2) The Java classes: jawin/lib/jawin.jar (it seems this is the one > Christophe is talking about, and the one that causes trouble). > > *ad 2 - the jar file)* Like for all other Java projects you first and > foremost need to get the jar file into your applications classpath. > Since it is packaged in a .jar-file, the location of it doesn't matter > [1], you will have no matter what have to include it actively in your > classpath. > > I assume you are launching your program from a console with the "java > ..." command? If not, please mail back. Then you should set the > classpath "on-the-fly" as: > > java -classpath %CLASSPATH%;c:/jawin-1.0.19/lib/jawin.jar "YourProgram" > > (where I assume jawin is in the root of C:. And that you of course > substitute "YourProgram" with the relevant class for you program). > > *ad 1 - the dll file)* This should be set exactly as mentioned in the > Jawin introduction: > > java -Djava.library.path=c:/jawin-1.0.19/bin > > (again assuming Jawin is in the root of C:) > > *So to sum thing up* > This will give us a full launch command like: > > java -classpath %CLASSPATH%;c:/jawin-1.0.19/lib/jawin.jar > -Djava.library.path=c:/jawin-1.0.19/bin "YourProgram" > > The classpath part MAY accept backward slashes instead of the forward > slashes. But for the java.library.path part I think you MUST use forward > slashes (although I haven't time pt. to test that it will not work with > backward slashes, I assume this is the case). > > So note that the option for including the jar file, includes the jar > file itself. Whereas the option for including the dll file, only points > to the directory containing the dll file (yes, this is not very > consistent :-) - but thats just the way the JRE are). > > Best Regards, and hopes this helps you > Morten > > notes: > [1] Unless you are running in e.g. an application server or have your > java.ext.dir-property set to the folder containing the jar-file. DON'T > do this, unless you know what you are doing, and the consequences of it. > > Roy Collins wrote: > > [SNIP]