Nodeclipse / nodeclipse

Nodeclipse-1 : Eclipse plugin for Node.js, PhantomJS development (Nodeclipse core plugin); Maven and Gradle (with Android) plugins
https://nodeclipse.github.io/
158 stars 78 forks source link

Non standard Node executable path or name was: Unable to start nodeclipse on ubuntu 14 #158

Closed broadbear closed 10 years ago

broadbear commented 10 years ago

After a new installation of eclipse/nodeclipse plugin on ubuntu 14, I was unable to restart eclipse. I see the below error in .log. It looks like the binary name is hard coded in the PreferenceInitializer class as 'node', however, on ubuntu there is a package name conflict, so the binary is named 'nodejs.'

!ENTRY org.eclipse.equinox.preferences 4 2 2014-07-23 22:52:07.621
!MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.equinox.preferences".
!STACK 0
java.lang.IllegalStateException: Could not find Node.js.
        at org.nodeclipse.ui.preferences.PreferenceInitializer.findNode(PreferenceInitializer.java:158)
        at org.nodeclipse.ui.preferences.PreferenceInitializer.initializeDefaultPreferences(PreferenceInitializer.java:92)
        at org.eclipse.core.internal.preferences.PreferenceServiceRegistryHelper$1.run(PreferenceServiceRegistryHelper.java:300)
        at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
        at org.eclipse.core.internal.preferences.PreferenceServiceRegistryHelper.runInitializer(PreferenceServiceRegistryHelper.java:303)
        at org.eclipse.core.internal.preferences.PreferenceServiceRegistryHelper.applyRuntimeDefaults(PreferenceServiceRegistryHelper.java:131)
        at org.eclipse.core.internal.preferences.PreferencesService.applyRuntimeDefaults(PreferencesService.java:368)
        at org.eclipse.core.internal.preferences.DefaultPreferences.applyRuntimeDefaults(DefaultPreferences.java:166)
        at org.eclipse.core.internal.preferences.DefaultPreferences.load(DefaultPreferences.java:237)
paulvi commented 10 years ago

Just check related code https://github.com/Nodeclipse/nodeclipse-1/blob/master/org.nodeclipse.ui/src/org/nodeclipse/ui/preferences/PreferenceInitializer.java#L135-158

and you see that it can't just find node executable in any places that are usual. So you just need to install Node.js that is likely missing.

If you really have Node.js executable as nodejs and not node, please continue and give more exactly details about paths, why it is so...

paulvi commented 10 years ago

A workaround to Eclipse unable to start could be to put some file named node in some standard paths where it should be. Then start Eclipse and specify other Node path.

paulvi commented 10 years ago

The bad thing is that I can't really check how it work on Ubuntu and in situation you described.

Could you please get code and build.

broadbear commented 10 years ago

Here is some additional information: http://stackoverflow.com/questions/18130164/nodejs-vs-node-on-ubuntu-12-04

A workaround is to create a symlink: sudo ln -s /usr/bin/nodejs /usr/bin/node

paulvi commented 10 years ago

OK, so it is about using Node installed with https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager#ubuntu-mint

I think there should be symlink /usr/bin/node anyway (to run conveniently from command line)

Then Nodeclipse should catch up /usr/bin/node as standard Lunix location.

So while throwing Exception is removed, no new code is needed to handle this special case.

paulvi commented 9 years ago

Or better

sudo update-alternatives --install /usr/bin/node node /usr/bin/nodejs 10