Print at Jan 21, 2026, 7:55:12 AM
Posted by buzzz at Jul 9, 2023, 3:27:03 AM
automatically open .sh3d file on a Mac
Hi all,

When I double click on the .sh3D file on my mac, I would like that the file is automatically loaded into SW.

What is the correct approach ?

I see that in build.xml, there is a build option for:
ponderis3D-version-macosx-10.4-10.9.dmg

If I use this dmg installation, does it automatically configure the app and the association between .sh3D files and the app ?

Thx for help

Posted by buzzz at Jul 18, 2023, 5:20:25 PM
Re: automatically open .sh3d file on a Mac
Lol... I just notice that the file name was incorrect :)

We can call that a "lapsus revelateur" :D

Posted by Puybaret at Jul 20, 2023, 1:15:41 PM
Re: automatically open .sh3d file on a Mac
The associations between an application bundle and the files extensions is indicated in the UTExportedTypeDeclarations section of its Info.plist file.
Look at the one of Sweet Home 3D,, it's self-explanatory.
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D creator

Posted by buzzz at Jul 20, 2023, 2:09:30 PM
Re: automatically open .sh3d file on a Mac
I have to test this on my Mac.

can you tell me what version of java (I assume openjdk) needs to be installed for everything to work properly?

Posted by buzzz at Oct 6, 2023, 2:55:31 PM
Re: automatically open .sh3d file on a Mac
Hi all,

I have to test the .app build these next days. Currently I have a mac with Ventura 13.6. Which version of java do you use for that ?

Thx for help

Posted by Puybaret at Oct 6, 2023, 3:24:22 PM
Re: automatically open .sh3d file on a Mac
On macOS, Sweet Home 3D is bundled with Zulu 15.0.10 as indicated in its Ant project file.
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D creator

Posted by buzzz at Oct 6, 2023, 7:08:46 PM
Re: automatically open .sh3d file on a Mac
Thks Emmmanuel

Do I need to make an app build for each MacOS version ? 12 13 14 ?

I already notice that I have to build an intel plus arm version...

Posted by Puybaret at Oct 6, 2023, 7:41:49 PM
Re: automatically open .sh3d file on a Mac
Bundling Zulu 15.0.10 with Sweet Home 3D makes it able to run on macOS from 10.9 to 14.
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D creator

Posted by buzzz at Oct 8, 2023, 2:16:48 AM
Re: automatically open .sh3d file on a Mac
Hi

On my PC with Oracle Java 15.0.2, when I build the officiel SW7.1 source, I obtain the following messages:

[echo] compiling Sweet Home 3D for Java 1.7 minimum version
[mkdir] Created dir: Desktop\SweetHome3D-7.1-src\build\classes
[javac] Desktop\SweetHome3D-7.1-src\build.xml:68: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
[javac] Compiling 2 source files to Desktop\SweetHome3D-7.1-src\build\classes
[javac] warning: [options] bootstrap class path not set in conjunction with -source 7
[javac] warning: [options] source value 7 is obsolete and will be removed in a future release
[javac] warning: [options] target value 7 is obsolete and will be removed in a future release

But, on my mac (13.6), using Zulu 15.0.10 (Zulu 15.46), I obtain two errors:
[javac] error: source option 7 is no longer supported, Use 8 or later
[javac] error: Target option 7 is no longer supported, Use 8 or later

Any idea ?

Posted by buzzz at Oct 11, 2023, 12:08:37 PM
Re: automatically open .sh3d file on a Mac
Finally I force compilation with source="1.8", lots of warning, but it works

Posted by buzzz at Oct 11, 2023, 2:19:41 PM
Re: automatically open .sh3d file on a Mac
When I install the version of Zulu 15.0.10, it installs in the folder Library/Java/JavaVirtualMachines/zulu-15.jdk/Contents/Home

In build xml: I notice 2 differents paths depending on the architecture :
value="/Library/Java/JavaVirtualMachines/zulu-15.0.10-macosx_x86_64.jdk/Contents/Home"/>
and
<property name="javaHome_macosx_arm64" value="/Library/Java/JavaVirtualMachines/zulu-15.0.10-macosx_aarch64.jdk/Contents/Home"/>

I do not see how to obtain these two different folders..


So, Im a bit embarassed, because I do not have the dylib for the arm version.

Posted by Puybaret at Oct 11, 2023, 8:55:41 PM
Re: automatically open .sh3d file on a Mac
zulu-15.0.10-macosx_x86_64.jdk and zulu-15.0.10-macosx_aarch64.jdk folders are just renamed folders. As the build procedure needs both x86-64 and arm JDKs, I had to rename zulu-15.jdk folder.
By the way, take the zulu-15.jdk folder found in Zulu tar.gz files at Azul, not dmg files.
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D creator

Posted by buzzz at Oct 12, 2023, 2:00:57 AM
Re: automatically open .sh3d file on a Mac
I would never have found this on my own :)

Posted by buzzz at Oct 12, 2023, 2:02:05 AM
Re: automatically open .sh3d file on a Mac
Just a quick question, to build the dmg/app of SW for macos 13, I have to use : ant macosxInstaller

Is that correct ?

Posted by Puybaret at Oct 12, 2023, 1:05:02 PM
Re: automatically open .sh3d file on a Mac
I would never have found this on my own :)
It's noted in build.xml here but it could be more detailed...

to build the dmg/app of SW for macos 13, I have to use : ant macosxInstaller
Is that correct ?
macosxInstaller target will build a dmg but it won't be signed and can't be notarized, i.e. end users who download it will be able to run the application it contains only if they right click on it to select Open item in contextual menu. It's required only the fist time, and afterwards a simple double click will launch the program.

Note that if you encounter an error "hdiutil: create failed- Permission denied" at the end, add the line:
<arg value="-L"/>
in the statement which copies legal files to copy files matching symlinks, or use XCode 12 tools.
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D creator

Posted by buzzz at Oct 12, 2023, 3:30:46 PM
Re: automatically open .sh3d file on a Mac
Thks,

Yes, sometimes I randomly have strange folder errors like this.
Generally, I write: sudo ant macosxInstaller and it works :)

Posted by buzzz at Nov 22, 2023, 12:54:42 PM
Re: automatically open .sh3d file on a Mac
Hi,

I have created an .app working fine for intel Mac but not in M1/M2 OS.

First, I would want to know if I have to rebuild the app on an M1 Mac in order to make it works ?

Second, I take a look at the folder : \lib\java3d-1.6 and I see only one dylib file. Is it compatible with both Intel and M1/M2 chipsets ?

Thx for help.

Posted by Puybaret at Nov 22, 2023, 3:07:46 PM
Re: automatically open .sh3d file on a Mac
dylib files coming with the current version of Sweet Home 3D are universal libraries containing binary code for Intel 64 bit and ARM processors. Are you sure you use the last version of these dylibs? Does your build.xml file builds a universal JRE like Sweet Home 3D does?
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D creator

Posted by buzzz at Nov 24, 2023, 2:40:49 AM
Re: automatically open .sh3d file on a Mac
Hi

I work with the 7.1 version and I use the official build.xml of the repository.

Does this version normally works with M1/M2 ?

Is it better to upgrade it with the files of the 7.2 ? (libgluegen_rt / libjogl_desktop / libnativewindow_awt / libnativewindow_macosx)

I notice that you also update these files in 7.2 : gluegen-rt.jar / jogl-all.jar

Is it also a good idea to update them in my version ?

Posted by Puybaret at Nov 24, 2023, 10:05:36 AM
Re: automatically open .sh3d file on a Mac
Does this version normally works with M1/M2 ?
Apple Mx processors have been supported since version 6.5.

Is it better to upgrade it with the files of the 7.2 ?
Yes, you should better upgrade to JOGL 2.5 (dylib and jar files).
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D creator

Posted by buzzz at Nov 26, 2023, 4:10:55 AM
Re: automatically open .sh3d file on a Mac
Hi all

So I build SW7.1 with the official build.xml using macosxInstaller option. So, this time I have a M2 mac and I have tested my problem on Sonoma and Ventura.

It appears that when I click on SW7.1 icon, there is a strange message "Impossible d'ouvrir l'application". On intel version, we just have the emergency message about "unauthorized app". But this time nothing, just this strange message.

I run the app from cmd, and I obtain a very long message :

The application cannot be opened for an unexpected reason, error=Error Domain=RBSRequestErrorDomain Code=5 "Launch failed." UserInfo={NSLocalizedFailureReason=Launch failed., NSUnderlyingError=0x6000022f2ca0 {Error Domain=NSPOSIXErrorDomain Code=153 "Unknown error: 153" UserInfo={NSLocalizedDescription=Launchd job spawn failed}}}

Posted by buzzz at Nov 26, 2023, 4:17:14 AM
Re: automatically open .sh3d file on a Mac
As you previously write :
<<macosxInstaller target will build a dmg but it won't be signed and can't be notarized, i.e. end users who download it will be able to run the application it contains only if they right click on it to select Open item in contextual menu.>>
But this option is not available this time.
I try many many different options and I found no way.

Finally, I use a cmd command :

codesign --force --deep --sign - SW3D.app

and it works, which suggests that it is really a problem of signature

Posted by buzzz at Nov 26, 2023, 4:18:56 AM
Re: automatically open .sh3d file on a Mac
So apparently the unsigned build no more works, only if people are able to use zsh and write this little command.

What do you think about that ? Do you know this problem ? Have you any option ? It seems difficult

Posted by Puybaret at Nov 27, 2023, 7:19:29 PM
Re: automatically open .sh3d file on a Mac
I haven't made some tests on an unsigned version of Sweet Home 3D for a long time, so I tried again, and actually, there's an easier solution than the one you tried: if macOS refuses to open the downloaded application the first time, it accepts to open it the second time you right click on its icon. But this trick doesn't seem to work under macOS Sonoma, even after following Apple's suggestions or this more detailed page.
Maybe, you should consider subscribe to Apple Developer Program to get a certificate that you'll use to sign the application and notarize it.
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D creator

Posted by buzzz at Nov 27, 2023, 8:33:13 PM
Re: automatically open .sh3d file on a Mac
Thanks for checking, it confirms the problem :)

I'll see if I can suggest this option.

Posted by buzzz at Nov 27, 2023, 8:45:04 PM
Re: automatically open .sh3d file on a Mac
By the way, I update the four dylibs of my 7.1 version by the ones coming from 7.2 : libgluegen_rt / libjogl_desktop / libnativewindow_awt / libnativewindow_macosx

Doing this, when I double click the app, the app icon appears in the task bar but no window is showing. So I also update gluegen-rt.jar / jogl-all.jar

Nothing changes, the app does not show.

If you know what to do, I would love a hint :)

If you have to search for an answer, forget it. It currently works fine, I will not do this update.

Posted by Puybaret at Nov 27, 2023, 10:26:29 PM
Re: automatically open .sh3d file on a Mac
You should also update the build.xml script, inspiring you from these changes.
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D creator

Posted by buzzz at Nov 28, 2023, 3:59:07 AM
Re: automatically open .sh3d file on a Mac
Thanks !