Netbeans Apache 12.2 on macOS Big Sur only runs properly as super user - macos

When running as a normal user, if you click on Netbeans->Preferences the window will open, shake, flash, freeze, and not let you do anything. The same thing happens with the Tools->Plugins. Running as super user it works perfectly. I have cleaned up all NetBeans related files. You can see it in action here.
It's useless as it is.

Ive found a partial workaround for this.
You need to setup the OS not to open new documents as new tab.
Go to the Apple Menu, select System Preferences > General. In the Prefer tabs when opening documents option, select "never".
Then restart Netbeans and try to open Netbeans preferences.

If you don't want a system-wide change, you can set the following setting. It should affect only applications running on JDK, run this in terminal:
defaults write net.java.openjdk.cmd "AppleWindowTabbingMode" never
It turns out that is a problem related to the AppleWindowTabbingMode
settings. I was using "always", since I want that apps like Finder and
other use new tabs rather than new windows.
This settings worked fine with NetBeans since Catalina. So I reset the
behavior to "never" only for NetBeans, with the follow command
defaults write net.java.openjdk.cmd "AppleWindowTabbingMode" never
With this setting NetBeans works finally fine!
Sources: apparently, it's a bug, please see here and corresponding JDK bug.
Also, it's not a problem with NetBeans only. It affects AndroidStudio also see here for example:

If you choose to run it as root, here's what I use:
#!/bin/bash
APP=/Applications/NetBeans/Apache\ NetBeans\ 12.2.app/Contents/MacOS/netbeans
COMPLAINT="Netbeans must run as %U because of bugs in the UI implementation :{"
PROMPT=$(echo -e "${COMPLAINT}\nPlease enter your login password for privilege escalation:")
sudo -p "${PROMPT}" -b -s "${APP}"
This lets me limp by with a recent JDK (15.0.2) which placates the corresponding NetBeans (12.2, as you can see from the code). The -b option tells sudo to run the app in the background, which in this case means simply that the Terminal in which you ran this script will not be polluted with JDK whinging about "illegal reflective access".

Related

Gnome Shell extensions not loading, no error message available

I have two gnome-shell extensions that don't appear to be loading after upgrading to 3.24. In gnome-tweak-tool they have a warning sign icon with "Error loading extension", and nothing else. I tried using looking glass (lg), and it just says "Error", and that the extension "has not reported any errors".
How can I debug the extension to find out why exactly it's not loading?
I found the error in the systemd journal:
$ sudo journalctl /usr/bin/gnome-shell
Just simply run this on terminal:
gnome-extensions-app
and enable it to make the extensions work.
Works perfectly with GNOME 40
As mentioned on the Github page.
A Shell reload is required. Press Alt+F2 r Enter and the extension has to be enabled with gnome-tweak-tool or with dconf.
As mentioned on Dash to Dock's User reviews. Make sure you disable Ubuntu Dock if you are using this in Ubuntu, otherwise you are going to have conflicts.
To disable Ubuntu Dock type the following in terminal:
gnome-extensions disable ubuntu-dock#ubuntu.com
I also experienced the same error. I think I will like to state the procedures that I took to make mine to work, and then you can check to see if you got it wrong somewhere.
Here are the steps
First install the Gnome shell extensions package from the terminal
sudo apt install gnome-shell-extensions
And then reboot your system. After that, start GNOME Tweaks and you’ll find a few extensions installed. You can just toggle the button to start using an installed extension.
Next, go to GNOME Extensions website (GNOME User Themes Extensions) and download the extension with the latest version (Although, I often prefer to download the version next to the latest version, since it may be more stable).
Extract the downloaded file to the ~/.local/share/gnome-shell/extensions (home/.local/share/gnome-shell/extensions) directory. You can press Ctrl + H to show hidden folders. Create the extensions folder if you don't have it yet.
Now restart GNOME Shell. Press Alt+F2 and enter r to restart GNOME Shell.
Restart GNOME Tweaks tool as well. You should see the manually installed GNOME extension in the Tweak tool now. You can configure or enable the newly installed extension here.
That's all
I hope this helps
Loging in without wayland works for me.
My extension was not enabling. I just log out and log in back and ran this command.
gnome-extensions enable example#hammad.example.com
It worked in my case.

Mac OS X 10.8.1 - Files no longer being watched

Just updated to OS X 10.8.1. I'm not sure if this is the cause, but basically immediately after, programs are unable to check for file changes.
In my makefile, the following command does not work (it doesn't trigger on file changes)
watchr -e "watch('scripts/.*\.js') {system 'make scripts'}"
On Sublime Text, when I make a new file in a folder, that new file is not shown in the sidebar, but it is created correctly in the directly.
This command, however works (based on Node's watch command, I believe):
stylus -w -u nib styles/ie8.styl -o public/styles
Anyone know what's going on or how to debug?
Edit: This isn't working now after rebooting again. I hate this! :/
I also ran into this issue with Sublime Text 2 as well as Guard (it started using a polling fallback).
I believe I found a fix:
Download Onyx and run it with all of the options under the automation tab checked
After it's done shut down your machine and turn it back on
At this point I was suddenly able to see new directories created using mkdir in terminal from within the Sublime Text 2 file browser. Guard was also working without the polling fallback.
I hope this helps, it was really starting to get on my nerves.
This isn't going to be very informative but maybe it will help...
There is a thread in the Sublime Text forums discussing this issue and it doesn't seem to be secluded to OS X 10.8.1.
There also seems to be a thread about watchr not always working, and that issue seems to be platform independent as well.
I would bet that you've become the unwitting victim of the 'Mac OSX' env vars change ...
Please take a look at the following to determine if your env vars are set correctly on Mountain Lion as the environment.plist is now deprecated ...
Env Plist Deprecated
Mac OSX - Sublime

VIM Flashing Issue

I'm SSH'ing in from my mac OSX (10.6.8) to a school server running centOS5 and when I attempt to use VIM, it won't stop flashing inside the mac terminal. Any idea's on how to fix this? Keep in my mind I do not have the authority to modify any /etc files or /bin files on the server, although I believe I can locally on my user. Also I would love to see anyone's really cool .vimrc config file they want to share.
Try these out:
set visualbell t_vb= " turn off error beep/flash
set novisualbell " turn off visual bell
Though the link may go stale in the future, for the time being this is the source: http://phuzz.org/vimrc.html
I also know that you can set this via terminal options on the MAC, though this is not likely the issue if you are ssh-ing. Anyway, I hope it helps. Good luck! :)
I´ve just had the same issue.
I solved it by disabling the setting "Allow blinking text" in the terminal text settings as shown in this
screenshot.
Regarding .vimrc config there are tons of versions to be found on google, especially github is a good place to go.
to stop beeping & flashing in both the console & the GUI versions of Vim try:
set noerrorbells visualbell t_vb=
autocmd GUIEnter * set visualbell t_vb=
I was pretty frustrated with macvim installed via brew.
First, on installation, it had an issue with the python version.
I did upgrade brew and python. Then I started macvim but it was flashing really bad, to eliminate, I had to ***disable core text renderin***g under preferences -> advanced options.
Finally, it got stable but couldn't open files or tabs.
objc[80401]: Class FIFinderSyncExtensionHost is implemented in both
/System/Library/PrivateFrameworks/FinderKit.framework/FinderKit
(0x10d099200) and
/System/Library/PrivateFrameworks/FileProvider.framework/OverrideBundles/FinderSyncCollaborationFileProviderOverride.bundle/Contents/MacOS/FinderSyncCollaborationFileProviderOverride
(0x115309c00). One of the two will be used. Which one is undefined.
So I decided to get rid off it altogether.
brew uninstall --force macvim
Installed it manually from here.
Once installed, I used the following command to create an alias. Add the following line to your .bashrc or .zshrc (for iTerm users).
alias mvim=/Applications/MacVim.app/Contents/MacOS/MacVim -g
Now reload your terminal session and type mvim. Enjoy!!

How to open Terminal at last open directory?

Every time I open my Terminal application at work it starts from a clean slate (e.g. it opens from the ~/ directory). But at home on my laptop my Terminal always remembers the last directory I was in (and all the commands on the screen) and displays them to me.
I'm trying to get this to happen when I'm at work but I can't find any information on it (I've no idea why or how my laptop managed to set itself to work that way?).
The only thing I've found out is that I can change the preferences so the Terminal executes a particular command when the app is started up, but that's not quite what I want (simply because I'm not sure what command I would run to get the Terminal to go to the directory I was looking at when I had the Terminal open last).
Any ideas?
Thanks!
Since you're using Lion, it should do that automatically.
You might have disabled the Resume functionality systemwide or in Terminal.
Make sure it's enabled systemwide. You can also try to manually enable it for Terminal:
defaults write com.apple.Terminal NSQuitAlwaysKeepsWindows -bool true

How to Get Xcode to Not Automatically Open Previously Opened Projects

So, I opened a xib file from an older project and it caused a crash. That's not the issue. The issue is that now when I restart Xcode, it tries to open all previously opened projects (and files) and the crash re-occurs. Where does Xcode store the list of previously open files, and how can I get it to start 'clean' without any open projects?
Update: As a note - this is the latest version of Xcode 4.2 on Lion.
Press option+Shift when clicking on the Xcode icon in the dock. Xcode then starts without opening previously used projects. This is related to version Version 4.5.2 (4G2008a) but I am almost sure that I used it in older versions as well.
I've recently had a similar problem. I tried the methods above and could launch Xcode from the command line, but as soon as I tried to open from the finder, it would try to open the "bad" document and hang.
I eventually resolved it by removing the contents of :
~/Library/Autosave Information/
~/Library/Saved Application State/com.apple.dt.Xcode.savedState
This seems to have fixed it for me.
I just spent half the day stressing over a very similar issue. I had tried updating and reinstalling Xcode - but the problem still persisted. Thankfully, a few minutes ago, I managed to solve this by doing what your question states with the help of this post.
Basically, I opened another Xcode project (it can be any file, though) from the terminal using the following command:
open -a /Applications/Xcode.app app.xcodeproj/ --args -ApplePersistenceIgnoreState YES
This successfully launched Xcode with the standard 'Welcome to Xcode' dialog box you usually get. Hope that helps!
I was able to do it with the following command line in Mavericks:
open -a /Applications/Xcode.app --args -ApplePersistenceIgnoreState YES
Not specific to Xcode:
Please make sure Close windows when quitting an application checkbox is checked under System Preferences > General.
You can stop Xcode from opening the last project by running the following command:
defaults write com.apple.dt.Xcode ApplePersistenceIgnoreState -bool YES
This and other useful commands are here.
Instead of looking for the file that contains Xcode's settings, take a look at the settings themselves using the defaults command:
% defaults read com.apple.xcode | more
I notice two keys that might be relevant: NSRecentXCFileDocuments and NSRecentXCProjectDocuments. Both appear to be arrays, so you could reset one like this:
% defaults write com.apple.xcode NSRecentXCFileDocuments -array ""
Alternately, you could use the defaults read command to dump the settings into a text file, edit that, and then use defaults write to update the settings:
% defaults read com.apple.xcode > xcsettings.plist
// edit xcsettins.plist with your favorite editor
% defaults write com.apple.xcode < xcsettings.plist
Given the project name "MyProject" in directory ~/Documents/Projects/MyProject do the following:
cd ~/Documents/Projects
mv MyProject MyProject.x
open -a Xcode
close MyProject (Option+Command+W)
mv MyProject.x MyProject
open -a Xcode
The this solved the crash for me... however my Storboard was corrupt. Fortunately the Time Machine backup of the folder was intact, I just restored it.
For me it wasn't a project that was causing the crash on startup, it was a particular file (an sks to be exact), so Kay's answer didn't work. When I went to open my particular project, it would still crash.
I simply temporarily deleted the file. Then I opened the project, cleaned, and re-added the file, and all was well.
I think Xcode may update its cache when you quit. It solved my issue to:
close projects
quit Xcode
reopen Xcode.

Resources