I get the following error when making the Java JNI Wrapper for OpenKinect:
java: symbol lookup error:
/home/richard/libfreenect/wrappers/java/dist/libOpenKinect.so:
undefined symbol: libusb_init
I use the Ubuntu Manual Install with the following exceptions:
git://github.com/michael-nischt/libfreenect.git instead of git://github.com/OpenKinect/libfreenect.gitworks, because the JNI wrapper isn't integrated into the main distribution.
freeglut3-dev instead of libglut3-dev.
I am able to run glview successfully.
I modify the build.sh script so that LIBFREENET_LIBRARY refers to the correct directory. The jar build then compiles successfully. The example file compiles correctly.
javac -d ./ -classpath .:./dist/OpenKinect.jar ./OpenKinect/src/Example.java
I get the error when I run:
java -Djava.library.path=./dist -classpath .:./dist/OpenKinect.jar Example
Has anyone else experienced this error?
Has anyone been able to resolve this error?
Verify the dependencies of the shared library libOpenKinect.so:
ldd /home/richard/libfreenect/wrappers/java/dist/libOpenKinect.so/libsample.so
You must find a line with libusb-1.0.so.0. If not this mean that the library is not link to libusb. A solution is to recompile the shared library with the flag -lusb-1.0:
Related
I run into the following problem: Upon running of the GPIO-example for my device built-in in Pi4J, I get an JNI error, followed by a NoClassDefFoundError for the com/pi4j/io/gpio/GpioProvider.
After some searching (both here and other websites) I came to the conclusion that I was missing the pi4j-gpio-extension.jar. Turns out I have to include these specifically while compiling. I was using:
pi4j --compile Gpioblabla.java
which is a macro/shorthand/dont know for
+ javac -classpath '.:classes:*classes:/opt/pi4j/lib/*' -d . Gpioblabla.java
This successfully compiles.
After running the program I get the NoClassDefError.
So the question is, how to explicitly include certain .jar files in pi4j/javac compilation?
Found the error. You need to run it with the classpath as well. So run it like:
java -classpath '.:classes:*classes:/opt/pi4j/lib/*' Gpioblabla
I'm getting the following error in Eclipse, when I try to run a Batch file via the External Tools feature (in the Run menu).
:
C:\Eclipse_Java\AutonomicUsingJMX\adelthesis\src\fixedMessageApp>cd C:\Eclipse_Java\AutonomicUsingJMX\adelthesis\src\fixedMessageApp
C:\Eclipse_Java\AutonomicUsingJMX\adelthesis\src\fixedMessageApp>javac -cp commons-io-2.4.jar FixedMessageSequenceServer.java
FixedMessageSequenceServer.java:18: error: cannot find symbol
private FixedMessageSequenceProtocol fmsp;
This is my batch file :
cd C:\Eclipse_Java\AutonomicUsingJMX\adelthesis\src\fixedMessageApp
javac -cp commons-io-2.4.jar FixedMessageSequenceServer.java
java FixedMessageSequenceClient.java
java FixedMessageSequenceClient
pause
echo finished
But everything is in one project folder within Eclipse :
Any clues on what is going wrong with my code ? I'm thinking my batch file is incorrect, but not sure
Cannot find symbol is a compilation error. Check the commands individually to see which one is having the problem.
See this related answer: https://stackoverflow.com/a/25706217/288915
I have exported my Eclipse Java project in Ubuntu, with all the .java and .class files in place.
The project is composed as follows:
- src
- package1
- file1.java
...
- fileN.java
...
- packageM
- fileM.java
...
- fileN.java
To run the program, I use the following command:
java -Djava.library.path="/path/to/opencv/lib" -cp lib/*:src package.to.main.class.MainClass
Now, I have changed just a line in a class (which is not the MainClass), and I would like to recompile and run everything. However, when trying with javac in the following way:
javac path/to/main/class/MainClass.java
I obtain millions of errors since:
libraries are not found
other Java files are not linked
Some examples:
src/it/polimi/tweetcrawlingpipeline/pipeline/TweetCrawlingPipeline.java:7: error: package org.opencv.core does not exist
import org.opencv.core.Core;
^
symbol: class SVMSample
location: class TweetCrawlingPipeline
src/it/polimi/tweetcrawlingpipeline/pipeline/TweetCrawlingPipeline.java:158: error: cannot find symbol
public GenericClassifier<SVMSample> getTextClassifier() {
^
How can I fix these problems?
Thanks.
This might not be the answer you want, but it rapidly gets to be painful to compile at the command line with just javac. Unless you put your command and classpath into a shell script, it can get fiddly.
If at all possible, I would recommend using something like ant, gradle, or even maven. Well maven can be overkill, but ant is a reasonable start.
In terminal, I get the follow error after I compile my program:
WriteExcel.java:7: error: package jxl does not exist
I compiled the program by typing:
javac -cp /Desktop/folder/src/jxl.jar WriteExcel.java
Basically, how do I get the compiler to recognize the external library?
Command line is "D:\Progra~1\Java\jre6\bin\java.exe -jar D:\Old\Clojure\clojure.jar D:\Old\Clojure\clojure-contrib.jar"
Following error appears:
clojure.lang.Compiler$CompilerException: clojure-contrib.jar:0: Unable to resolve symbol: PK♥♦ in this context
clojure-contrib version is 1.1.0
How to invoke clojure with libraries right?
Did you try installing Clojure Box? It seems to be the prefered way to install Clojure in Windows according to http://en.wikibooks.org/wiki/Clojure_Programming/Getting_Started#Windows I've found the page very helpful when installing for other platforms.
One thought is that you're passing two jars to -jar and not on the classpath. You probably want something like:
java.exe -cp d:\old\clojure-contrib.jar -jar d:\old\clojure.jar
I'd guess that your CLI invocation is causing clojure.jar to be launched by itself, and then clojure is trying to read in clojure-contrib.jar as an argument.