javacpp
The missing bridge between Java and native C++
Where does JavaCpp look for the native library libmynativelib.so
when it creates the jni library, /linux-x86_64/libjnimynativelib.so
?
JavaCpp is told about the C++ header and shared library using the @Platform
annotation like this:
@Platform(include={"MyLibraryHeader.h"}, link = "mynativelib")
@Namespace("mynamespace")
public class MyLibrary {
...
}
The above Java class is then compiled and run through JavaCpp like this:
javac -cp javacpp.jar MyLibrary.java
java -jar javacpp.jar -cp ../.. # classpath is parent of com/mypackage dir
Then JavaCpp output:
Generating /<projpath>/jniMyLibrary.cpp
Compiling /<projpath>/linux-x86_64/libjniMyLibrary.so
g++ -I/usr/lib/jvm/java-7-openjdk-amd64/include -I/usr/lib/jvm/java-7-openjdk-amd64/include/linux <path>/jniMyLibrary.cpp -Wl,-rpath,$ORIGIN/ -march=x86-64 -m64 -Wall -O3 -fPIC -shared -s -o /<projpath>/linux-x86_64/libjnimynativelibrary.so -lmynativelib
Which gives this error:
/usr/bin/ld: cannot find -lmynativelib
g++ is not finding libmynativelib.so
either in the current dir () or in the linux-x86_64 subdir.
LD_LIBRARY_PATH=<projdir>
doesn't help.
What is the recommended way to tell JavaCpp which native library to load?
Source: (StackOverflow)
I am trying to use this example in my java app which is build using maven.
pom.xml include
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<id>javacpp</id>
<phase>process-classes</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>java</executable>
<arguments>
<argument>-jar</argument> <argument>/home/JCuda/javacpp.jar</argument>
<argument>-classpath</argument> <argument>${project.build.outputDirectory}:/home/JCuda/jcuda-0.5.0.jar:/home/JCuda/jcusparse-0.5.0.jar</argument>
<argument>-d</argument> <argument>${project.build.outputDirectory}/lib/</argument>
<argument>-properties</argument> <argument>linux-x86_64-cuda</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
When nvcc is compiling .cu file it shows error
/home/TestWebapp6/target/classes/lib/jniCudaOps.cu(1154): error: a namespace name is not allowed
which in code is this line
JNIEXPORT void JNICALL Java_com_skenzo_cuda_CudaOps_copy(JNIEnv* env, jclass cls, jobject arg0, jobject arg1, jobject arg2) {
thrust* ptr0 = arg0; //line showing the first error
thrust* ptr1 = arg1;
....
Any clues?
Source: (StackOverflow)
On my 64 bit Mac OSX Trying to use a native C++ library from a java project just as described in this link:
https://github.com/bytedeco/javacpp-presets/tree/master/tesseract
But I get this error when I run the example, library liblept.4.dylib is not loaded, and I have no idea what to do.
java.lang.UnsatisfiedLinkError: no jnilept in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1865)
Caused by:java.lang.UnsatisfiedLinkError:/private/var/folders/h8/wpw5p9196v1dz0hcy_s66_5w0000gn/T/javacpp21146551279247/libjnilept.dylib: dlopen(/private/var/folders/h8/wpw5p9196v1dz0hcy_s66_5w0000gn/T/javacpp21146551279247/libjnilept.dylib, 1): Library not loaded: /Users/saudet/projects/bytedeco/javacpp-presets/leptonica/cppbuild/macosx-x86_64/lib/liblept.4.dylib
Referenced from: /private/var/folders/h8/wpw5p9196v1dz0hcy_s66_5w0000gn/T/javacpp21146551279247/libjnilept.dylib
UPDATE: I tried to install tesseract and leptonica libraries via mac ports, this error has disappered but a new error came "java failed to write core dump, problematic frame leptonica..etc"
So I removed all installed libraries again returned back to same error
Source: (StackOverflow)
I'm trying to grab frames from an Video file in android, the only alternative (tha is already compiled an ready for use) is the videoToGif Project. It uses JavaCV, JavaCpp and Java SE inside Android! The final apk is really big, but I'm doing just an academic project...
ERROR
I'm using the follow code:
ModifiedFrameGrabber frameGrabber = new ModifiedFrameGrabber(VIDEO_PATH);
IplImage frame = null;
try
{
frameGrabber.start();
frame = frameGrabber.grab();
} catch(Exception e){...}
byte[] data = frame.getByteBuffer().array();
In the last line I get the error:
Caused by: java.lang.UnsupportedOperationException
at java.nio.DirectByteBuffer.protectedArray(DirectByteBuffer.java:292)
at java.nio.ByteBuffer.array(ByteBuffer.java:144)
at my.package.onCreate(MyClass:x)
Anyone can help me with that? It seems that the proble is in Java API...
Source: (StackOverflow)
I'm trying to call JavaCV's groupRectangles function. Here is the method signature
@Namespace("cv") public static native void groupRectangles(@StdVector("CvRect,cv::Rect") CvRect rectList,
@StdVector IntPointer weights, int groupThreshold, double eps/*=0.2*/);
From the OpenCV documentation, parameters one and two should be std::vector<>'s. I would assume I should pass in some form of Java array (native array, List, etc.), however, the method only has an annotation for a @StdVector, and accepts just a single object.
Can someone please provide a very small snippet of code showing how to properly call this method by passing in two Java lists or arrays or whatever.
Source: (StackOverflow)
I am getting this error when trying to call the start()
method of an instance of FFmpegFrameGrabber
:
java.lang.UnsatisfiedLinkError: org.bytedeco.javacpp.avutil
at java.lang.Class.classForName(Native Method)
at java.lang.Class.forName(Class.java:309)
at org.bytedeco.javacpp.Loader.load(Loader.java:390)
at org.bytedeco.javacpp.Loader.load(Loader.java:358)
at org.bytedeco.javacpp.avformat$AVFormatContext.<clinit>(avformat.java:2539)
at org.bytedeco.javacv.FFmpegFrameGrabber.startUnsafe(FFmpegFrameGrabber.java:383)
at org.bytedeco.javacv.FFmpegFrameGrabber.start(FFmpegFrameGrabber.java:377)
These are the dependencies I am referring to per the READMES for the projects javacpp and javacv:
compile group: 'org.bytedeco', name: 'javacpp', version: '1.0'
compile group: 'org.bytedeco', name: 'javacv', version: '1.0'
I did not add any .so files to the project, but I was expecting those to come with the dependencies. When I tried adding them previously I started getting gradle errors for duplicate files so I assume that they come with the dependencies.
I think what is happening is that it can't load the .so files for whatever reason, but I don't know how to solve this problem.
I have tried setting the systemProperty
for dependencies mentioned in the GitHub READMEs like so:
task execute(type: JavaExec) {
systemProperty "platform.dependencies", true
}
It doesn't help as written.
Why is this error seen and what can be done to handle it?
Any guidance on this issue would be greatly appreciated. The overall goal is to use the FFmpegFrameGrabber to crop video the user has taken with their device. I am open to all solutions.
Source: (StackOverflow)
I’m trying to compare two histograms from grayscale images.
I’m using the CV_COMP_CHISQR (0.0 perfect match – 1.0 total mismatch). I normalized both histograms to 1.
But when I compare the histograms I get result over 40.0 which make no sense.
I don´t know if maybe I missing some step or maybe something is wrong.
Here is a snap of the code.
public class Histogram {
public static void main(String[] args) throws Exception {
String baseFilename = ".../imgs/lp.jpg";
String contrastFilename = ".../imgs/lpUrb.jpg";c/surf_javacv/box_in_scene.png";
IplImage baseImage = cvLoadImage(baseFilename);
CvHistogram hist=getHueHistogram(baseImage);
IplImage contrastImage = cvLoadImage(contrastFilename);
CvHistogram hist1=getHueHistogram(contrastImage);
double matchValue=cvCompareHist(hist, hist1, CV_COMP_CHISQR );
System.out.println(matchValue);
}
private static CvHistogram getHueHistogram(IplImage image){
if(image==null || image.nChannels()<1) new Exception("Error!");
IplImage greyImage= cvCreateImage(image.cvSize(), image.depth(), 1);
cvCvtColor(image, greyImage, CV_RGB2GRAY);
//bins and value-range
int numberOfBins=256;
float minRange= 0f;
float maxRange= 255f;
// Allocate histogram object
int dims = 1;
int[]sizes = new int[]{numberOfBins};
int histType = CV_HIST_ARRAY;
float[] minMax = new float[]{minRange, maxRange};
float[][] ranges = new float[][]{minMax};
int uniform = 1;
CvHistogram hist = cvCreateHist(dims, sizes, histType, ranges, uniform);
// Compute histogram
int accumulate = 0;
IplImage mask = null;
IplImage[] aux = new IplImage[]{greyImage};
cvCalcHist(aux,hist, accumulate, null);
cvNormalizeHist(hist, 1);
cvGetMinMaxHistValue(hist, minMax, minMax, sizes, sizes);
System.out.println("Min="+minMax[0]); //Less than 0.01
System.out.println("Max="+minMax[1]); //255
return hist;
}
}//CLass end
Source: (StackOverflow)
I am trying to run there own example of LegacyLibrary on http://code.google.com/p/javacpp/
when I try to compile code with following command mentioned at site only (basically compiling code with javacpp.jar) I am getting following exception
D:\Java Workspace\POC\JavaCPP\bin>java -jar javacpp.jar LegacyLibrary
Generating source file: D:\Java Workspace\POC\JavaCPP\bin\jniLegacyLibrary.cpp
Building library file: D:\Java Workspace\POC\JavaCPP\bin\windows-x86\jniLegacyLibrary.dll
cl "/IC:\Program Files (x86)\Java\jdk1.6.0_03\include" "/IC:\Program Files (x86)\Java\jdk1.6.0_03\include\win32" "D:\Java Workspace\POC\JavaCPP\bin\jniLegacyLibrary.cpp" /W3 /Oi
/O2 /EHsc /Gy /GL /MD /LD /link "/OUT:D:\Java Workspace\POC\JavaCPP\bin\windows-x86\jniLegacyLibrary.dll"
Exception in thread "main" java.io.IOException: Cannot run program "cl": CreateProcess error=2, The system cannot find the file specified
at java.lang.ProcessBuilder.start(ProcessBuilder.java:459)
at com.googlecode.javacpp.Builder.build(Builder.java:189)
at com.googlecode.javacpp.Builder.generateAndBuild(Builder.java:234)
at com.googlecode.javacpp.Builder.main(Builder.java:479)
Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified
at java.lang.ProcessImpl.create(Native Method)
at java.lang.ProcessImpl.<init>(ProcessImpl.java:81)
at java.lang.ProcessImpl.start(ProcessImpl.java:30)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:452)
... 3 more
what the remedy for this ?
Source: (StackOverflow)
I have a c++
header file which contains some functions that the c++
code calls. These function should be mapped to corresponding Java
functions.
So it is a bit like callbacks, but I cannot figure out how to map them in JavaCpp
.
So for instance we have a header file:
#ifdef __cplusplus
extern "C" {
#endif
typedef void (*F_ADDDCALLBACK)(uint32_t arg1, uint32_t arg2, int8_t *arg3);
extern F_ADDDCALLBACK m_CB;
void F_RegisterCallbacks(F_ADDDCALLBACK cb);
void F_Init();
void F_SomeOtherFunction(uint32_t arg1, uint8_t *arg2);
#ifdef __cplusplus
}
#endif
When these functions are called from some c++
code, it should in turn call some java
code.
How do I map this in JavaCpp
?
Source: (StackOverflow)
I have project that collects dependencies for an installer (sbt-install4j) using dependencyClasspath
. It works most of the time, except when I have one specific dependency:
libraryDependencies += "org.bytedeco" % "javacpp" % "0.10"
"javacpp" will not be added to the dependencyClasspath
. You can create a simple SBT project with only that dependency above and try show dependencyClasspath
, it will print:
[info] List(Attributed(C:\Users\me\.sbt\boot\scala-2.10.4\lib\scala-library.jar))
there is no "javacpp". Any clues what may be happening? Is this an SBT bug?
Source: (StackOverflow)
I'm trying to build and run the LegacyLibrary Example of JavaCpp with Visual Studio 2008 on Windows XP Professional (x86) using JDK 1.7.0 and JavaCpp 0.3 (bin), and I get the following output. The error is on the last command, java -cp javacpp.jar LegacyLibrary
.
C:\Documents and Settings\Brian\My Documents\Projects\Copy of Hello_JNI\src\graf
\JavaCpp>dir
Volume in drive C has no label.
Volume Serial Number is 9099-0685
Directory of C:\Documents and Settings\Brian\My Documents\Projects\Copy of Hell
o_JNI\src\graf\JavaCpp
22/01/2013 10:19 AM <DIR> .
22/01/2013 10:19 AM <DIR> ..
04/11/2012 09:00 PM 109,991 javacpp.jar
22/01/2013 10:18 AM 297 LegacyLibrary.h
22/01/2013 10:19 AM 1,058 LegacyLibrary.java
3 File(s) 111,346 bytes
2 Dir(s) 362,833,334,272 bytes free
C:\Documents and Settings\Brian\My Documents\Projects\Copy of Hello_JNI\src\graf
\JavaCpp>javac -cp javacpp.jar LegacyLibrary.java
C:\Documents and Settings\Brian\My Documents\Projects\Copy of Hello_JNI\src\graf
\JavaCpp>java -jar javacpp.jar LegacyLibrary
Generating source file: C:\Documents and Settings\Brian\My Documents\Projects\Co
py of Hello_JNI\src\graf\JavaCpp\jniLegacyLibrary.cpp
Building library file: C:\Documents and Settings\Brian\My Documents\Projects\Cop
y of Hello_JNI\src\graf\JavaCpp\windows-x86\jniLegacyLibrary.dll
cl /IC:\jdk1.7.0\include /IC:\jdk1.7.0\include\win32 "C:\Documents and Settings\
Brian\My Documents\Projects\Copy of Hello_JNI\src\graf\JavaCpp\jniLegacyLibrary.
cpp" /W3 /Oi /O2 /EHsc /Gy /GL /MD /LD /link "/OUT:C:\Documents and Settings\Bri
an\My Documents\Projects\Copy of Hello_JNI\src\graf\JavaCpp\windows-x86\jniLegac
yLibrary.dll" /LIBPATH:C:\jdk1.7.0\lib /LIBPATH:C:\jdk1.7.0\jre\bin\server jvm.l
ib
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 15.00.21022.08 for 80x86
Copyright (C) Microsoft Corporation. All rights reserved.
jniLegacyLibrary.cpp
C:\Documents and Settings\Brian\My Documents\Projects\Copy of Hello_JNI\src\graf
\JavaCpp\jniLegacyLibrary.cpp(113) : warning C4996: 'strcpy': This function or v
ariable may be unsafe. Consider using strcpy_s instead. To disable deprecation,
use _CRT_SECURE_NO_WARNINGS. See online help for details.
c:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\string.h(74) : s
ee declaration of 'strcpy'
C:\Documents and Settings\Brian\My Documents\Projects\Copy of Hello_JNI\src\graf
\JavaCpp\jniLegacyLibrary.cpp(115) : warning C4996: 'strncpy': This function or
variable may be unsafe. Consider using strncpy_s instead. To disable deprecation
, use _CRT_SECURE_NO_WARNINGS. See online help for details.
c:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\string.h(157) :
see declaration of 'strncpy'
C:\Documents and Settings\Brian\My Documents\Projects\Copy of Hello_JNI\src\graf
\JavaCpp\jniLegacyLibrary.cpp(185) : warning C4996: 'strdup': The POSIX name for
this item is deprecated. Instead, use the ISO C++ conformant name: _strdup. See
online help for details.
c:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\string.h(207) :
see declaration of 'strdup'
C:\Documents and Settings\Brian\My Documents\Projects\Copy of Hello_JNI\src\graf
\JavaCpp\jniLegacyLibrary.cpp(340) : warning C4244: 'argument' : conversion from
'jlong' to 'size_t', possible loss of data
C:\Documents and Settings\Brian\My Documents\Projects\Copy of Hello_JNI\src\graf
\JavaCpp\jniLegacyLibrary.cpp(354) : warning C4244: 'argument' : conversion from
'jlong' to 'size_t', possible loss of data
C:\Documents and Settings\Brian\My Documents\Projects\Copy of Hello_JNI\src\graf
\JavaCpp\jniLegacyLibrary.cpp(370) : warning C4244: 'argument' : conversion from
'jlong' to 'size_t', possible loss of data
C:\Documents and Settings\Brian\My Documents\Projects\Copy of Hello_JNI\src\graf
\JavaCpp\jniLegacyLibrary.cpp(385) : warning C4244: 'argument' : conversion from
'jlong' to 'size_t', possible loss of data
C:\Documents and Settings\Brian\My Documents\Projects\Copy of Hello_JNI\src\graf
\JavaCpp\jniLegacyLibrary.cpp(393) : warning C4244: 'argument' : conversion from
'jlong' to 'size_t', possible loss of data
C:\Documents and Settings\Brian\My Documents\Projects\Copy of Hello_JNI\src\graf
\JavaCpp\jniLegacyLibrary.cpp(956) : warning C4800: 'jboolean' : forcing value t
o bool 'true' or 'false' (performance warning)
Microsoft (R) Incremental Linker Version 9.00.21022.08
Copyright (C) Microsoft Corporation. All rights reserved.
/out:jniLegacyLibrary.dll
/ltcg
/dll
/implib:jniLegacyLibrary.lib
"/OUT:C:\Documents and Settings\Brian\My Documents\Projects\Copy of Hello_JNI\sr
c\graf\JavaCpp\windows-x86\jniLegacyLibrary.dll"
/LIBPATH:C:\jdk1.7.0\lib
/LIBPATH:C:\jdk1.7.0\jre\bin\server
jvm.lib
jniLegacyLibrary.obj
Creating library jniLegacyLibrary.lib and object jniLegacyLibrary.exp
Generating code
Finished generating code
C:\Documents and Settings\Brian\My Documents\Projects\Copy of Hello_JNI\src\graf
\JavaCpp>java -cp javacpp.jar LegacyLibrary
Exception in thread "main" java.lang.UnsatisfiedLinkError: C:\Documents and Sett
ings\Brian\Local Settings\Temp\javacpp92803190928456\jniLegacyLibrary.dll: Can't
find dependent libraries
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1928)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1825)
at java.lang.Runtime.load0(Runtime.java:792)
at java.lang.System.load(System.java:1059)
at com.googlecode.javacpp.Loader.loadLibrary(Loader.java:422)
at com.googlecode.javacpp.Loader.load(Loader.java:372)
at com.googlecode.javacpp.Loader.load(Loader.java:319)
at LegacyLibrary$LegacyClass.<clinit>(LegacyLibrary.java:8)
at LegacyLibrary.main(LegacyLibrary.java:22)
C:\Documents and Settings\Brian\My Documents\Projects\Copy of Hello_JNI\src\graf
\JavaCpp>
Source: (StackOverflow)
How to create the contour to pass to cvContourArea? I have four 2D points, but don't know to create the CvSeq.
int[] myPolygon = new int[] { point1.x, point1.y, point2.x, point2.y, ... };
cvCountourArea(???, null, 0);
Source: (StackOverflow)
So I'm having a problem with running some javaCV code, and though I've seen numerous fixes online for it, none have worked.
The exact error is java.lang.UnsatisfiedLinkError: /tmp/javacpp/libjniopencv_core.so cannot open shared object file: no such file or directory
I looked in /usr/local/lib (where it should be looking) and I have a bunch of shared objects in that directory such as libopencv_core.so.2.4. None of them have jni in the name though. This makes me think I missed a step. Where are the opencv jni so files supposed to have come from?
I'm running on a Raspberry Pi (ARM) if that matters.
Source: (StackOverflow)
Already have a project that working, and I am trying to improve it,
by gradle do some part of the job automatic.
I define the project in this build.gradle.
I download manual opencv-2.4.11-0.11-android-arm.jar from here, and extract it.
Then define jniLibs.srcDirs, copy all *.so
from the jar to that Dir,
Then Android Studio compile it correctly and put all the *.so
file in the right
location inside the aar
and then after that inside the apk
.
What I am asking, is how the Android Studio will automatically will download this jar, extract it, and put the *.so
file in the right location.
Any Suggestions?
Thanks for the Help,
Tal.
Edit
Found these pages:
Start to look at this direction.
Add two new task for debug:
def installDir = "${buildDir}/install"
def extractDir = "${buildDir}/extract"
// task to copy dependencies
task copyDependencies(type: Copy) {
from configurations.compile.findAll{
it.name.startsWith("opencv")
}
into installDir
}
// task to extract dependencies
task extractDependencies(type: Copy) {
from configurations.compile.findAll{
it.name.startsWith("opencv")
}
.collect{
zipTree (it).findAll{
it.name.endsWith("class")
}
}
into extractDir
}
Need to solve 4 problems:
- Tell Android Studio to use this task when it compile the library,
and not manual to call gradle task inside Android Studio.
- The library don't use opencv-2.4.11-0.11-android-arm.jar, so it nor copy it, nor extract it.
I need to understand how tell gradle task / Android Studio to copy / extract it by force,
even it not compile it.
- When I tell the extract task to extract file with specific extension,
It doesn't preserve the inside path that the file was in the jar.
Need to understand how I preserve this directory structure.
- When Select extract file by extenuation, doesn't extract all the file with that extension.
If you have some partly solution it ok here to publish.
Source: (StackOverflow)
I'm being tasked with creating a module for a large Java based framework which can communicate with DLL's comp-iled form C++ code.
After looking at the options, I narrowed them down to the JNI, JNA and the javacpp by bytedeco. The latter two are essentially various forms of wrappers intended to shield people like me (who haven't touched Java in years) from the intricacies of the JNI framework.
Anyways, following the giude found at https://github.com/bytedeco/javacpp, I have reached the point where I'm ready to compile and test, but I hit a major snag: The last parts of the isntructions tell me to run these three commands:
$ javac -cp javacpp.jar LIBRARYNAME.java
$ java -jar javacpp.jar LIBRARYNAME
$ java -cp javacpp.jar LIBRARYNAME
I'm using NetBeans on a Windows10 64-bit installation. So I installed Cygwin to get a console running in NetyBeans. I found the folders where Maven saves the modules downloaded for the project, including the javacpp.jar jar-file. And now I cannot get any fruther. If I navigate CygWin to the correct filepath containing my target .java file, it cannot find the javacpp file (and yes, I have added the PATH to the maven repository subfolders). If I tell it the classpath to the javacpp.jar file, it just ignores me and claims it aint there. Any help to get this working would be much appreciated!
Adding classpath to the Maven folder:
pne@PNE-LT /cygdrive/c/Users/pne/Dropbox/PHD/Code/<SNIP>/modelcommunicator
$ export PATH=$PATH:"/cygdrive/C/Users/pne/.m2/repository/org/bytedeco/javacpp/1.1/"
Following instructions from the guide:
pne@PNE-LT /cygdrive/c/Users/pne/Dropbox/PHD/Code/<SNIP>/modelcommunicator
$ javac -cp javacpp.jar MAEXP.java
MAEXP.java:12: error: package org.bytedeco.javacpp does not exist
import org.bytedeco.javacpp.*;
^
MAEXP.java:13: error: package org.bytedeco.javacpp.annotation does not exist
import org.bytedeco.javacpp.annotation.*;
^
MAEXP.java:15: error: cannot find symbol
@Platform(include="MAEXP.h")
^
symbol: class Platform
MAEXP.java:16: error: cannot find symbol
@Namespace("MAEXP")
^
symbol: class Namespace
MAEXP.java:18: error: cannot find symbol
public static class MAEXPClass extends Pointer{
^
symbol: class Pointer
location: class MAEXP
MAEXP.java:23: error: cannot find symbol
public native @StdString String stringTest(String txt);
^
symbol: class StdString
location: class MAEXPClass
MAEXP.java:19: error: cannot find symbol
static {Loader.load();}
^
symbol: variable Loader
location: class MAEXPClass
7 errors
I figured it might want me to specify both locatiosn, so I tried the following with the exact same errors:
$ javac -cp /cygdrive/C/Users/pne/.m2/repository/org/bytedeco/javacpp/1.1/javacpp.jar ./MAEXP.java
As for the MAEXP file, it simply contains the barebones code needed to test if I can access a C++ compiled DLL, as follow:
import org.bytedeco.javacpp.*;
import org.bytedeco.javacpp.annotation.*;
@Platform(include="MAEXP.h")
@Namespace("MAEXP")
public class MAEXP {
public static class MAEXPClass extends Pointer{
static {Loader.load();}
public MAEXPClass() { allocate(); }
public native void allocate();
public native @StdString String stringTest(String txt);
}
}
Source: (StackOverflow)