Java 11 support
An interior design application to draw house plans & arrange furniture
Brought to you by:
puybaret,
space-mushrooms
Build error with openjdk 11:
Buildfile: /tmp/work/usr/ports/cad/sweethome3d/work/SweetHome3D-6.3-src/build.xml build: [mkdir] Created dir: /tmp/work/usr/ports/cad/sweethome3d/work/SweetHome3D-6.3-src/build/classes [javac] /tmp/work/usr/ports/cad/sweethome3d/work/SweetHome3D-6.3-src/build.xml:47: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds [javac] Compiling 2 source files to /tmp/work/usr/ports/cad/sweethome3d/work/SweetHome3D-6.3-src/build/classes [javac] warning: [options] bootstrap class path not set in conjunction with -source 1.3 [javac] error: Source option 1.3 is no longer supported. Use 6 or later. [javac] error: Target option 1.1 is no longer supported. Use 1.6 or later. BUILD FAILED /tmp/work/usr/ports/cad/sweethome3d/work/SweetHome3D-6.3-src/build.xml:47: Compile failed; see the compiler error output for details. Total time: 1 second *** Error code 1
Run error with openjdk11 (build was with openjdk8):
июл. 02, 2020 4:58:00 PM java.util.prefs.FileSystemPreferences$1 run INFO: Created user preferences directory. Exception in thread "main" java.lang.reflect.InvocationTargetException at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at com.eteks.sweethome3d.SweetHome3DBootstrap.main(Unknown Source) Caused by: java.lang.NoClassDefFoundError: javax/media/j3d/GraphicsConfigTemplate3D at com.eteks.sweethome3d.SweetHome3D.addComponent3DRenderingErrorObserver(Unknown Source) at com.eteks.sweethome3d.SweetHome3D.init(Unknown Source) at com.eteks.sweethome3d.SweetHome3D.main(Unknown Source) ... 5 more Caused by: java.lang.ClassNotFoundException: Class javax.media.j3d.GraphicsConfigTemplate3D at com.eteks.sweethome3d.tools.ExtensionsClassLoader.findClass(Unknown Source) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:589) at com.eteks.sweethome3d.tools.ExtensionsClassLoader.loadClass(Unknown Source) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522) ... 8 more
The build errors make me think that you didn't build Sweet Home 3D with JDK 8.
Probably a simple path error. I would uninstall JDK 11, build Sweet Home 3D with remaining JDK 8, and reinstall JDK 11 to run Sweet Home 3D with it.
It run fine on same host with openjdk8.
(Tried rm -rf ~/.java before every start too).
It runs with Java 11 too except under macOS at rhe moment.
What Java3D version do you use with OpenJDK 11?
How did you compiled it with OpenJDK 11?
I got error during build Java3D 1.5.2 with OpenJDK 11:
$ uname -srm FreeBSD 12.1-RELEASE-p6 amd64
Last edit: VVD 2020-07-03
After replace several "1.5" with "1.6" I got error with "new sun.applet.AppletAudioClip(url)" - replaced it with "com.sun.media.sound.JavaSoundAudioClip.create(url) (https://bugs.openjdk.java.net/browse/JDK-8204454).
Then few "dances" with ">" symbol in comments.
But how to replace javah tag with javac in j3d-core/src/native/build.xml I don't know…
Compiling requires JDK 5 to 8 and running it JDK or JRE 5 and above.
So closed it because it build with Java 11 now?
Thanks!
It runs with with Java 11 in your case, that what counts no?
Last edit: Emmanuel Puybaret 2020-07-29
Ofc no.
How did you install java3d in OpenJDK11?
Last edit: VVD 2020-07-29
Read README.TXT
Last edit: Emmanuel Puybaret 2020-07-29
I can't find answer on my question in README.TXT…
Java3D install 4 files in OpenJDK8:
/usr/local/openjdk8/jre/lib/amd64/libj3dcore-ogl.so
/usr/local/openjdk8/jre/lib/ext/j3dcore.jar
/usr/local/openjdk8/jre/lib/ext/j3dutils.jar
/usr/local/openjdk8/jre/lib/ext/vecmath.jar
If I run SweetHome3D with OpenJDK8 - it found all required files.
But if I try to run with OpenJDK11 - it can't find Java3D files.
Work fine:
/usr/local/openjdk8/bin/java -Xmx1024m -jar /usr/local/share/java/classes/SweetHome3D-6.4.jar
Doesn't work:
/usr/local/openjdk11/bin/java -Xmx1024m -jar /usr/local/share/java/classes/SweetHome3D-6.4.jar
Can I add some options to make SweetHome3D work with OpenJDK11?
Last edit: VVD 2020-07-29
Why would you install Java 3D? It's already provided with Sweet Home 3D.
And sorry to insist, but why do you want to compile Sweet Home 3D?
The SweetHome3D-6.4-linux-x64.tgz comes with a JRE 8 and Java 3D libraries, and if you want to run Sweet Home 3D with Java 11, you can run it with the Jar executable version which includes Java 3D too and with the command
java -jar SweetHome3D-6.4.jar
If the latest command doesn't work, you could add the option which forces the program to use an older version of Java 3D:
java -Dcom.eteks.sweethome3d.j3d.version=1.5.2 -jar SweetHome3D-6.4.jar
Last edit: Emmanuel Puybaret 2020-07-29
I'm using FreeBSD with native build of OpenJDK8/11 and SweetHome3D: https://svnweb.freebsd.org/ports/head/cad/sweethome3d/
I updated the Ant script of Sweet Home 3D 6.5 to make it possible to build it with Java ≥ 9.
SweetHome3D 7.1, still can't build with OpenJDK 11: