Print at Dec 16, 2025, 3:51:06 AM

Posted by Keet at Sep 8, 2023, 2:03:04 PM
Re: Categories
What Linux distribution do you use?

On my Debian/Mate system I have this:
/your-directory-somewhere/SH3D/SweetHome3D-7.1 where the Sweet Home 3D 64 .tgz download is extracted.
After extracting the .tgz in that directory there are subdirectories runtime/bin where the Java runtime resides.

I use the Sweet Home 3D startup script SweetHome3D-Java3D-1_5_2 which looks like this:
#!/bin/sh

# Retrieve Sweet Home 3D directory
PROGRAM=`readlink "$0"`
if [ "$PROGRAM" = "" ]; then
PROGRAM=$0
fi
PROGRAM_DIR=`dirname "$PROGRAM"`

# Run Sweet Home 3D
exec "$PROGRAM_DIR"/runtime/bin/java -Duser.name=Keet -Xmx6g -classpath "$PROGRAM_DIR"/lib/SweetHome3D.jar:"$PROGRAM_DIR"/lib/Furniture.jar:"$PROGRAM_DIR"/lib/Textures.jar:"$PROGRAM_DIR"/lib/Examples.jar:"$PROGRAM_DIR"/lib/Help.jar:"$PROGRAM_DIR"/lib/batik-svgpathparser-1.7.jar:"$PROGRAM_DIR"/lib/jeksparser-calculator.jar:"$PROGRAM_DIR"/lib/iText-2.1.7.jar:"$PROGRAM_DIR"/lib/freehep-vectorgraphics-svg-2.1.1c.jar:"$PROGRAM_DIR"/lib/sunflow-0.07.3i.jar:"$PROGRAM_DIR"/lib/jmf.jar:"$PROGRAM_DIR"/lib/j3dcore.jar:"$PROGRAM_DIR"/lib/j3dutils.jar:"$PROGRAM_DIR"/lib/vecmath.jar:"$PROGRAM_DIR"/lib/jnlp.jar -Djava.library.path="$PROGRAM_DIR"/lib:"$PROGRAM_DIR"/lib/yafaray -Dcom.eteks.sweethome3d.applicationId=SweetHome3D#Installer com.eteks.sweethome3d.SweetHome3D -open "$1"
This is the original script where I have added "-Duser.name=Keet" and set the memory usage to 6Gb with "-Xmx6g".
The default script SweetHome3D should work the same.

For the Furniture Library Editor I have created this script in the same directory as the SweetHome3D-Java3D-1_5_2 script:
#!/bin/sh
# Retrieve Sweet Home 3D directory
PROGRAM=`readlink "$0"`
if [ "$PROGRAM" = "" ]; then
PROGRAM=$0
fi
PROGRAM_DIR=`dirname "$PROGRAM"`

exec "$PROGRAM_DIR"/runtime/bin/java -Duser.name=Keet -jar /your-directory-somewhere/SH3D/tools/FurnitureLibraryEditor-1.31.jar -open "$1"

As you can see I have created a directory 'tools' in the SH3D directory I use for the Sweet Home 3D installation. In that directory I have the various versions of the Furniture and Texture Library Editor .jar files.
(You don't have to add the -Duser,name=?? to the script. I do that so it overrules the linux username that is otherwise used in .sh3d files. It's a security/privacy thing.)

With this setup Sweet Home 3D and the Furniture Library Editor use the same Java runtime in the runtime/bin directory. Of course I did the same for the TextureLibraryEditor.

You already know how to create the menu-items.
I don't use these because I always work from the file manager. After a new install I right-click a .sh3d file and select the 'Open with other application' option. Then I browse to the SweetHome3D-Java3D-1_5_2 script and select that. On Debian/Mate I have the checkbox 'Remember ...' which makes the choice the default for .sh3d files. From now on I can just double-click on any .sh3d file and it will start Sweet Home 3D with that project.
You can do the same for library files and of course for another version of Sweet Home 3D like the beta.
----------------------------------------
Dodecagon.nl
1300+ 3D models, manuals, and projects