I recently got a Raspberry Pi 2 and have been trying to get a program using Java/Java 3D that I've used before on the previous Model B to run on it.
The Pi is running Raspbian, and I've installed the libjava3d-java and libjava3d-jni packages.
I've copied the following files into a lib folder:
j3dcore.jar
j3dutils.jar
vecmath.jar
libj3dcore-ogl.so
I've then included -Djava.library.path="lib/*" in the command I use to run my program, but I'm getting an UnsatisfiedLinkError: no J3D in java.library.path
Could there be any other files that I need? Might I have an incorrect version of the native libraries? All the files I've put in the lib folder are ones that I've found in the system as installed by the package manager.
Thanks for reading
I assume that you're trying to install an obsolete version of Java3D (1.5.2 or earlier). Please follow these instructions to download and install Java3D 1.6.0.
Java3D uses the fixed pipeline, it is designed to use OpenGL whereas the Raspberry Pi supports OpenGL ES. Java3D 1.6.0 uses mostly the same public API than Java3D 1.5.2 and we have done no change to make it work with OpenGL ES. It has a very few chances to work as is on your device.
Rather use JMonkeyEngine 3, LibGDX or JogAmp's Ardor3D Continuation with its JOGL renderer. The two first ones work with the Raspberry Pi for sure, the last one still needs some work.
Edit.: You have a chance to make it work with Eric Anholt's driver, it already works with Processing 3 on a Raspberry Pi 2: http://labb.zafena.se/?p=972
Related
I have written JavaFX app with Maven, now I want to convert it to executables. I was successful at generating .exe file for Windows using launch4j-maven-plugin, for mac I'm using appbundle-maven-plugin, it generates .app, but it doesn't work (for M1), saying JRELoadError, I think it's because of my cpu architecture as I'm not using x86 one, I've tried with few versions of jdk, including one that I use to launch it in IntelliJ.
So my complete question is this: How to get M1 mac compatible .app from Java GUI Maven project? (I prefer to have as a Maven plugin if possible).
You could earn yourself a few bonus points by giving this https://github.com/dlemmermann/JPackageScriptFX little framework a try. I don't have an M1 Mac, so I cannot try it myself but in principle this should work with maybe a few tweaks. You may have to upgrade to the latest EA builds of Java 18 and also JavaFX 18 because there have been some recent bug fixes.
Disclaimer: I am biased because I developed this framework together with Dirk.
I have a Raspberry Pi 2, and an arduino pro micro set up as a Joystick. On the Pi i have a java application that runs well on a PC with both Linux and Windows with the arduino joystick connected. But as soon as I start running the program on the pi I get an error message like:
`Failed to load library:" /libjinput-linux64.so: /libjinput-linux64.so`
After some googling around i find that the problem is that the Jinput library is not compiled to run on ARM processors:
JInput on RaspberryPi
So far so good, but this far I could not find a solution as to how I get the .so file compiled to run on the arm processor. I guess it is somewhat trivial for someone with the knowledge, since the file is easily decompiled and the project is open source.
But I have been stuck at this stage for the last 1½ month. Any help as to how to compile it where to find the files that are to be compiled and such, or alternatively finding an already compiled file for the raspberry pi 2 would be helpful.
Not a direct answer about how to compile JNI libraries, but there appears to be a pre-compiled version available on Raspbian:
> apt search jinput
Sorting... Done
Full Text Search... Done
libjinput-java/stable 20100502+dfsg-7 all
Java Game Controller API
libjinput-java-doc/stable 20100502+dfsg-7 all
Java Game Controller API (javadoc)
libjinput-jni/stable 20100502+dfsg-7 armhf
Java Game Controller API (jni)
So the solution may be to just apt install libjinput-java; this will probably include the -jni package as a dependency (see here).
I'm attempting to run the Java version of OpenCV on a hosted Ubuntu server. I have an existing application built using Eclipse from my own windows environment and i want to move it over to my server to run it there. However i am having several issues with it.
The problem is that when i try to run it i receive the following error:
Now there are existing question with varying answer to this problem already on SO, the problem being the UnsatisfiedLinkError, but i have tried to follow them to no avail.
I have eclipse pointing the native library location to where opencv is located on the server itself as so;
But i still have the same problem. I am compiling this project as a Runnable Jar File if that makes any difference.
The paths must match (between Windows and Linux) and you must have the right native file for each system included (and tested for).
Currently in your Eclipse environment you are pointing to a Windows implementation of OpenCV - how will Linux know where to look?
I would make sure Eclipse includes all libraries when creating a runnable jar file (it is a checkable option), and make sure that your .dll and .so files all go into the same location regardless of system (so make sure the opencv dll is in c:\var\lib\opencv and libopencv_java249 is in /var/lib/opencv on the linux box)
In your program, since versions may not be the same, when loading the library in - do it this way too:
System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
That way it will use whatever version is current on your system.
I have Kinect for xbox. I have installed Kinect SDK.
I am trying to program Kinect using Java in Eclispe IDE. I have tried several tutorials. I have installed:
openni-win64-1.5.4.0-dev.msi
nite-win64-1.5.2.21-dev.msi
SensorKinect092-Bin64-v5.1.2.1.msi
sensor-win64-5.1.2.1-redist.msi
and it didn't work, when I run NiSimpleRead it open and then close immediately.
also I have tried to install all above but win32 and it also didn't work.
I have installed ZigFuOpenNI.exe and the problem still exists.
I have tried the tutorial installation of J4K library using the instructions in this site:
http://research.dwi.ufl.edu/ufdw/j4k/eclipse.php
and also it is not working it seems that there is problem with jogl and gluegen-rt native libraries because when I open the folders in the Package Explorer they are empty, but I am following the instructions correctly.
In my case, Kinect only works with Processing 2.2.1. I have tried the examples in this program using SimpleOpenNI and it works.
My question is how can I connect Kinect to Java in Eclipse.
I would be very much appreciated for helping me.
I'm having some major issues with getting JOGL to work on snow leopard.
I've installed all the necessary JOGL jars in
/system/library/java/extensions
I can get sample code to compile but when I attempt to run it it throws the error following error on trying to actually display the window.
Exception in thread "main" java.lang.RuntimeException: Unable to initialize JAWT
at com.sun.nativewindow.impl.jawt.JAWT$1.run(JAWT.java:100)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.nativewindow.impl.jawt.JAWT.getJAWT(JAWT.java:95)
at com.sun.nativewindow.impl.jawt.macosx.MacOSXJAWTWindow.lockSurface(MacOSXJAWTWindow.java:65)
at com.sun.opengl.impl.GLDrawableImpl.lockSurface(GLDrawableImpl.java:144)
at com.sun.opengl.impl.macosx.cgl.MacOSXCGLDrawable.setRealizedImpl(MacOSXCGLDrawable.java:87)
at com.sun.opengl.impl.GLDrawableImpl.setRealized(GLDrawableImpl.java:120)
at javax.media.opengl.awt.GLCanvas.addNotify(GLCanvas.java:413)
at java.awt.Container.addNotify(Container.java:2622)
at java.awt.Window.addNotify(Window.java:662)
at java.awt.Frame.addNotify(Frame.java:470)
at java.awt.Window.show(Window.java:858)
at java.awt.Component.show(Component.java:1563)
at java.awt.Component.setVisible(Component.java:1515)
at java.awt.Window.setVisible(Window.java:841)
at SimpleJOGL.main(SimpleJOGL.java:45)
Has anyone seen this error before and if they have how did you fix it?
Regards
James
EDIT: This error appears using both Java 1.5 and Java 1.6 and I've tried JOGL beta 5, beta 10 and the nightly builds
What build of JOGL are you using, and what version of Java (1.5 or 1.6)? There was some talk of the beta 5 release having this issue. I found this link. It's a shot in the dark but without more information it's all I have.
JOGL Kenai Link
I was able to download a version of JOGL from the following link
JOGL JSR 231 Beta 10
I downloaded the mac universal zip and was able to get it working by putting the jars on the classpath and pointing the java.library.path to the the directory I unzipped the archive to. The archive includes all of the .so files you need to get JOGL running. I don't think you need all of the jars included here. There seem to be a lot of files related to the CDC, which I think is a mobile platform if memory serves. I didn't include these in my test.
I didn't get the error you mentioned and am running Snow Leopard on a Core Duo MacBook Pro. The used the source from the Gears demo and it ran without a hitch. I even switched out the Frame with a JFrame to see if that would change anything. It worked fine both ways. You may want to try with this library and see if that works for you.