netbeans-macos-bundle
netbeans-macos-bundle copied to clipboard
TCC failure app does not have necessary permissions
I was wondering if you had realised that Apache did a lot of work producing a native launcher for macOS to trigger the necessary folder permissions dialog? If you call the launcher script directly the permissions dialog is never triggered with consequent faliure after a few launches, cannot acccess Documents folder. I am not sure how to produce a pull request and I think it may be a challenge to link to the binary launcher it is buried in a subfolder of Apache distribution.
Thank you yes we are aware but have not yet found a fix. I generally don’t access documents because my projects are in $HOME/dev but I now realize this is an issue for some. If you have a fix that would be great. I have only looked briefly.
I had a look at this, I'm not sufficient to the task but I got it working. Main issue is NetbeansLauncher is not bundled in binary distribution, it is located in nb/ide.launcher/macosx
and requires Xcode. I just don't see how this can be automated without a separate step. After that replace symlink in MacOS
with NetbeansLauncher and rename it and everything works. Finally folder NetBeans
must be moved to NetBeans/netbeans
ah, that is helpful...will take a look
so far I have not been able to make NetBeans run as expected using the launcher...I am prompted for access to Documents, etc. as expected but the files are not opening correctly.
If you could provide a bit more specifics (are you building the launcher on M1 or Intel?, etc.) it might be helpful
to be explicit this folder contains source of launcher https://github.com/apache/netbeans/tree/master/nb/ide.launcher/macosx if you examine source it is a direct call to unix script, not much to do, as long as it's compiled on your platform should just work. If netbeans is not opening files correctly then that would be a bug, as long as permissions are set in System Preferences it is probably something else.
Yes, sorry, I should have been a bit more specific (you did provide a good bit of useful info). I did find and build the macOS launcher for both M1 and Intel. I removed the sym link and replaced it with the launcher and modified the directory structure as you described (new netbeans folder in NetBeans).
My test results were consistent. I did, as I believe I understood you to say, get prompted for folder (Documents, Desktop in my case) access and I was able to create projects. But the curious behavior was no files will open in the editor. I have not yet made time to look for exceptions associated with the process (beyond looking at the command line because I launched NetBeans via both the GUI and the command line).
ok not sure what's different but it is working on Intel now - I may have had some residual configuration issues (not checked on M1 again yet but I will a bit later today) - for now, there's a "launcher" branch with the updates - assuming it works ok on M1, will clean up launcher download (determine arch, etc.) - thank you for your help on this - seems pretty close now
on the M1 machine, changing the version of Java back to 11 from 17 seems to have addressed the file opening issue - I am not convinced this is the issue itself but I could not open files until I made that change - in the meantime if you would like to test the launcher branch on either or both platforms, I would appreciate it
I have tried the new branch, it seems to be OK. I note that NetBeansLauncher
is a single-architecture, I am told there is a work around to create a universal binary https://stackoverflow.com/a/71085010 this may be worth doing as it is unlikely NetBeansLauncher
will have to be touched when there is a new release.
lipo -archs ./MacOS/netbeans
x86_64
Regarding Java 17 issue on M1, under Java 11 it would be using Rosetta almost certainly, Java 17 comes in an aarch64 flavour. You may ask netbeans authors about that, it needs to examined, some interaction with TCC?
Agreed...it seems the one binary launcher works for both archs (was not expecting that) (uname also works to get arch). With respect to Java 17, I need to test more, but unless/until I add the launcher, I am not seeing the "file won't open" issue so we're on the same page there. I need to look for this behavior with the other installer.
Assuming all is good, need some logic to fail back to symbolic link method for backwards compatibility.
Thank you for testing.
Going to be needed on every platform since macOS 10.15 Apple do not support Mojave AFAIK, is backwards compatibility really required? There is a very interesting issue #3467 on apache/netbeans discussing arm_64 and terminal missing binaries. https://github.com/apache/netbeans/issues/3467#issuecomment-1015495868
Good question, no, it's not required but I originally put the script together using the old "anything to be done more than once is worth automating" perspective (admittedly a bit of an exaggeration) during a time when I was using a number of (older) NB versions. I tend not to keep versions on my computers and the script allows to be put in a version at the command line and have it installed. If someone says "x" was working on version "y" and it interests me, I sometimes reinstall. Frankly, I don't know how often this is even used/needed any more but I have not really put much time into it so I don't mind (trying to) keep it relatively useful when I have the cycles. :)
On the issue you referenced...thank you...you're on top of this. I had not poked around for this yet.