When you want to use OpenCV or any other native libraries on Playframework, You MUST run your application with "play start" command, not "play run".
"play run" command starts your application in development mode and "play start" command starts in production mode. I don't know every difference between them but one obvious thing is ,
Only when we use "play start", a new JVM for you application is launched and it loads native libraries you specified by System.load("/absolute/path/to/your/so/or/jnilib/inOSX/not/dylib/filename.jnilib");
How to load native lib is following.
Create Global.java which has empty package name. (refer this link )
public class Global extends GlobalSettings {
public void beforeStart(Application app) {
// TODO Auto-generated method stub
String libopencv_java = "/Users/yoonjechoi/git/myFirstApp/target/native_libraries/64bits/libopencv_java246.jnilib";
System.load(libopencv_java);
then you can use classes of OpenCV in your Play application's controllers.
System.loadLibrary("opencv_java246") doesn't works. I don't know why. I don't have time to dig why. -_-;
Please give hints if you know why.
2013년 7월 15일 월요일 오후 3시 13분 38초 UTC+9, Yoonje Choi 님의 말:
Hi, I'm try to use opencv on playframwork 2.1.1 ( mountain lion 10.8.4)