简体   繁体   中英

How to compile and run java files for OpenNI in linux

I'm trying out OpenNI for Kinect and got it to install and run sample code according to this guide . But now, I want to modify the code and compile it and test it. However, I'm not sure how to compile and run on Linux. I found a guide here that does it for Windows, but can't seem for the life of me to find anything for Linux.

I did try adapting the Windows code for Linux and tried

javac -cp ~/kinect/OpenNI/Samples/Bin/x86-Release/org.OpenNI.jar VersionInfo.java
java -cp ~/kinect/OpenNI/Samples/Bin/x86-Release/org.OpenNI.jar VersionInfo

but it gives me

Exception in thread "main" java.lang.NoClassDefFoundError: VersionInfo
Caused by: java.lang.ClassNotFoundException: VersionInfo
at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
Could not find the main class: VersionInfo. Program will exit.

Any ideas on how I can compile and run my java code onto the Kinect? If you know how to do it for the Samples in the OpenNI folder, that would be perfect.

Nevermind, figured it out. Turns out I needed to learn about make and Makefile s and how they're used to compile .java files into a .jar .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM