nealk2k3
Posts: 17
Joined: Thu May 17, 2012 8:01 pm

Java 3D on RPi2

Sat Feb 14, 2015 3:54 pm

I have a Java 3D project that I have previously run on an original Raspberry Pi Model B which I'm now trying to get running on the Pi2.

I've managed to find 'libjava3d-java' and 'libjava3d-jni' packages that the Pi2 running Raspbian was happy to install, but I can't get my program to run as I get the error 'UnsatisfiedLinkError: no J3D in java.library.path'

In the command to run I've include '-Djava.library.path="./lib/*"', and also made a 'lib' folder into which I've copied the following files:
j3d-core.jar
j3dutils.jar
vecmath.jar
libj3dcore-ogl.so

These are files that were installed by the system that I've just copied o=into one place for convenience.

At this stage, I'm not sure why the code won't run - does anyone have any suggestions?

Thanks for reading

Fidelius
Posts: 398
Joined: Wed Jan 01, 2014 8:40 pm

Re: Java 3D on RPi2

Tue Feb 17, 2015 12:50 pm

No, unfortunately no suggestions for Java3D.

However, many parts of Java3D have found their way into Java8's FX API. Then the neccessary OpenGL/-ES native libraries come with the Java 8 JRE and you can run your 3D programms on any Java8 VM without needing external native libraries. Also on our Pi (at least as long as we use Raspbian's current Java8, or bundle our application with JRE <= 1.8.0_06 ).

To see if Java8's 3D API is suitable for you, you could examine the official JDK8 samples (but for Linux or so, since for the ARM JDK8 they cut-down all the FX samples). And then import some Obj or Maja models, per:

Code: Select all

java -Dcom.sun.javafx.experimental.embedded.3d=true -jar 3DViewer.jar Monkey.obj
samples_readme.txt :

Code: Select all

[..]

Sample Descriptions
===================

The following samples are included in the zip file.

---------
Ensemble8

A gallery of sample applications that demonstrate a large variety of JavaFX 
features, including animation, charts, and controls. For each sample, you 
can do the following on ALL platforms:
  - View and interact with the running sample.
  - Read its description.
You can do the following for each sample on desktop platforms only:
  - Copy its source code.
  - For several samples, you can adjust the properties of the sample components. 
  - If you are connected to the internet, you can also follow links to the 
    relevant API documentation.

Ensemble8 also runs with JavaFX for ARM.

-------------
MandelbrotSet

A sample application that demonstrates advantages of parallel execution done 
using Java Parallel API. The application renders an image using Mandelbrot set 
algorithm and provides intuitive navigation within the range of input parameters. 
More information is available in index.html file inside the MandelbrotSet folder.

------
Modena

A sample application that demonstrates the look and feel of UI components using 
the Modena theme. It gives you the option to contrast Modena and Caspian themes, 
and explore various aspects of these themes.


------------
3DViewer

3DViewer is a sample application that allows the user to navigate and examine a 
3D scene with a mouse or a trackpad. 3DViewer has importers for a subset of the 
features in OBJ and Maya files. The ability to import animation is also 
provided for Maya files. (Note that in the case of Maya files, construction 
history should be deleted on all the objects when saving as a Maya file.) 
3DViewer also has the ability to export the contents of the scene as Java or 
FXML files.
Last edited by Fidelius on Tue Feb 17, 2015 6:33 pm, edited 3 times in total.

-rst-
Posts: 1316
Joined: Thu Nov 01, 2012 12:12 pm
Location: Dublin, Ireland

Re: Java 3D on RPi2

Tue Feb 17, 2015 3:22 pm

Are you sure about the java.library.path you have specified? I thought it should be path to a directory, so no '/*' at the end. Also might be good to take out the quotes (this may in cases impend the shell variable substitution) and possibly to use a fully qualified path (like /path/to/libs).
http://raspberrycompote.blogspot.com/ - Low-level graphics and 'Coding Gold Dust'

Helmut Pithan
Posts: 3
Joined: Sat Nov 28, 2015 9:05 am

Re: Java 3D on RPi2

Tue Dec 05, 2017 6:33 pm

Running java3d on a raspberry pi 2 / raspberry pi 3 with Bluej

Download the Image Raspbian Stretch With Desktop (Release 2017-11-29) and install it to a sd-card.
Start the system and install processing-3.3.6 by running the following in a terminal:
curl https://processing.org/download/install-arm.sh | sudo sh
Copy the contents of
/usr/local/lib/processing-3.3.6/core/library
to
/usr/share/bluej/userlib

Download from java3D 1.6.0 Final
at
https://github.com/hharrison/java3d-cor ... /tag/1.6.0

j3dcore.jar , j3dutils.jar, vecmath.jar
Move the three files to
to
/usr/share/bluej/userlib

Start Bluej and load java 3d examples.

Helmut Pithan
Posts: 3
Joined: Sat Nov 28, 2015 9:05 am

Re: Java 3D on RPi2

Tue Dec 05, 2017 6:40 pm

Running java3d on a raspberry pi 2 / raspberry pi 3 with Bluej

Download the Image Raspbian Stretch With Desktop (Release 2017-11-29) and install it to a sd-card.
Start the system and install processing-3.3.6 by running the following in a terminal:
curl https://processing.org/download/install-arm.sh | sudo sh
Copy the contents of
/usr/local/lib/processing-3.3.6/core/library
to
/usr/share/bluej/userlib

Download from java3D 1.6.0 Final
at
https://github.com/hharrison/java3d-cor ... /tag/1.6.0

j3dcore.jar , j3dutils.jar, vecmath.jar
Move the three files to
to
/usr/share/bluej/userlib

sudo raspi-config
Advanced Options
A6 Gl Driver. Enable/Disable experimental desktop
Start Bluej and load java 3d examples.

Return to “Java”

Who is online

Users browsing this forum: No registered users and 4 guests