sparkyspider
sparkyspider

Reputation: 13519

Netbeans 7.2 won't open on OS X

I installed Netbeans on OSX Mountain Lion running JDK 7. Everything was working fine. Then my machine for no reason crashed. After this I could no longer open Netbeans anymore.

If I try to start Netbeans from the commandline:

/Applications/NetBeans/NetBeans 7.2.app/Contents/MacOS/netbeans

Then it works fine. From there I can select Netbeans > About and confirm that my userdir and cachedir is:

User directory: /Users/<user>/Library/Application Support/NetBeans/7.2
Cache directory: /Users/<user>/Library/Caches/NetBeans/7.2

So, I deleted these directories and tried again, but alas, I can only start netbeans via the commandline.

Ideas appreciated...

Upvotes: 3

Views: 4140

Answers (3)

Matt
Matt

Reputation: 10564

Sounds to me like this is not a NetBeans problem at all, rather a problem with the bundle, such that OS X is not launching the app as it should.

To verify, I'd try opening NetBeans through Finder from the command line:

open -a "NetBeans 7.2.app"

This command will ask the system launcher to open the application as if you had clicked on the icon. In your case, it probably won't open. If this is true, then you know it's not something in your terminal environment that's allowing NetBeans to launch.

The next step that I would take would be to look at the package contents: examine /Applications/NetBeans/NetBeans 7.2.app/Contents/Info.plist for anything that seems amiss - this file is the information store that OS X looks for to see how to launch the package, what its icon is, etc... - in particular, I think you should look at the CFBundleExecutable value to see what command is used to launch the app. If it's not netbeans, you've found a big hint on what might be amiss: bundles are set up so that launchers should run bundle_dir.app/Contents/{platform}/{CFBundleExecutable_value}. Looking at CFBundleExecutable should show you if there's some other script used to launch the app than just running netbeans.

From this point, you'll have to do more digging, but hopefully this is enough information for you to get started tracking down how apps are launched from the OS X launcher. For more info and a better reference, check out this link, which is Apple's documentation for keys in Info.plist.

Finally, you should note that the launch information for all apps are heavily cached; I've heard that if you make a change to Info.plist, you have to rename the app bundle and name it back to have the changes picked up by the launcher.

Good luck!

Upvotes: 3

user1329572
user1329572

Reputation: 6406

To find the root cause, I would check the NetBeans logs, as detailed here

/Users/yourname/Library/Application Support/NetBeans/7.2/var/log/messages.log


And if that doesn't help, I'd archive your project(s) and put a clean install of NetBeans on your machine, and then import the archived project(s) back into NetBeans.

Upvotes: 1

kwikness
kwikness

Reputation: 1445

Here's an idea: use Eclipse >=)

..but seriously, something got corrupted in Netbeans' metadata/cache data files. You cleared a couple of them but there may be others elsewhere.

Try comparing the launch command in your shortcut to what you're typing in the console. Are they the same?

Upvotes: 1

Related Questions