I have tried to follow the JQuantLib tutorial. But it blocks when running SwapValuation test. I get the following error :
java.lang.UnsatisfiedLinkError: no QuantLibCppWrapper.dll in java.library.path
I have correctly set the PATH variable but it seems not to work...
I have then added the argument -Djava.library.path=C:\Projects\QuantLib Cpp Wrapper\Debug
I get then the error :
java.lang.NoClassDefFoundError: Cpp
Has someone an idea how to solve this problem?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
NoClassDefFoundError does not equal ClassNotFoundException. So, the problem probably comes from the fact that the dll was not found. Try these steps: put the 2 dlls in a directory. Put your compiled java files in the same directory (if your using a package then start your package structure from that directory). Then create a cmd file in that same directory which looks like this:
@echo off
set path=.;%path%
set classpath=.;%classpath%
java you java class
pause
This should@echo off
set path=.;%path%
set classpath=quantlib.jar;%classpath%
java test.org.quantlib.TestYieldCurve
pause
and then run it. If this runs fine, you have a problem with setting the path in your eclipse (or other) development environment. Try using quotes (sometimes space-bars in paths need to be refererd to using quotes) or try other ways to set the path correctly it should work.
If this isn't running correctly, then there must be something wrong with the library itselves. One thing that is very important is the library settings. Double check your library settings. (see http://users.telenet.be/johan.witters/website/skwash.com/get/get3gpart2.html\). The setting "Select GCC C++ Linker > Miscellaneous and specify -Wl,--add-stdcall-alias as Linker flags. " is very important.
Hope this helps
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have tried to follow the JQuantLib tutorial. But it blocks when running SwapValuation test. I get the following error :
java.lang.UnsatisfiedLinkError: no QuantLibCppWrapper.dll in java.library.path
I have correctly set the PATH variable but it seems not to work...
I have then added the argument -Djava.library.path=C:\Projects\QuantLib Cpp Wrapper\Debug
I get then the error :
java.lang.NoClassDefFoundError: Cpp
Has someone an idea how to solve this problem?
Sorry to answer so late... Holiday/busy
I have stumbled upon this problem also.
NoClassDefFoundError does not equal ClassNotFoundException. So, the problem probably comes from the fact that the dll was not found. Try these steps: put the 2 dlls in a directory. Put your compiled java files in the same directory (if your using a package then start your package structure from that directory). Then create a cmd file in that same directory which looks like this:
@echo off
set path=.;%path%
set classpath=.;%classpath%
java you java class
pause
This should@echo off
set path=.;%path%
set classpath=quantlib.jar;%classpath%
java test.org.quantlib.TestYieldCurve
pause
and then run it. If this runs fine, you have a problem with setting the path in your eclipse (or other) development environment. Try using quotes (sometimes space-bars in paths need to be refererd to using quotes) or try other ways to set the path correctly it should work.
If this isn't running correctly, then there must be something wrong with the library itselves. One thing that is very important is the library settings. Double check your library settings. (see http://users.telenet.be/johan.witters/website/skwash.com/get/get3gpart2.html\). The setting "Select GCC C++ Linker > Miscellaneous and specify -Wl,--add-stdcall-alias as Linker flags. " is very important.
Hope this helps