Netbeans 9 Requires Root Privileges to Run?

612 Views Asked by At

I have the latest version of Netbeans 9 and run it from a script called netbeans. I figured that it was an installer script and ran it the first time using root privileges, but it wasn't an installer script, it was the actual program.

Ever since this, it seems to require root privileges to run, terminating with this error message when run without sudo:

>Log Session: Wednesday, August 1, 2018 at 8:57:52 AM Eastern Daylight Time
>System Info:    Product Version         = Apache NetBeans IDE 9.0 (Build incubator-netbeans-release-334-on-20180708)   Operating System 
= Linux version 4.15.0-29-generic running on amd64   Java; VM; Vendor        = 10.0.2; Java HotSpot(TM) 64-Bit Server VM 10.0.2+13; Oracle Corporation   Runtime                 = Java(TM) SE Runtime Environment 10.0.2+13   Java Home               = /usr/lib/jvm/java-10-oracle   System Locale; Encoding = en_GB (nb); UTF-8   Home Directory          = /home/sarah   Current Directory     
= /home/sarah/Custom Programs/NetBeans 9/bin   User Directory          = /home/sarah/.netbeans/9.0   Cache Directory         = /home/sarah/.cache/netbeans/9.0   Installation            = /home/sarah/Desktop/Home/Custom Programs/NetBeans 9/nb
                            /home/sarah/Desktop/Home/Custom Programs/NetBeans 9/ide
                            /home/sarah/Desktop/Home/Custom Programs/NetBeans 9/extide
                            /home/sarah/Desktop/Home/Custom Programs/NetBeans 9/java
                            /home/sarah/Desktop/Home/Custom Programs/NetBeans 9/apisupport
                            /home/sarah/Desktop/Home/Custom Programs/NetBeans 9/websvccommon
                            /home/sarah/Desktop/Home/Custom Programs/NetBeans 9/profiler
                            /home/sarah/Desktop/Home/Custom Programs/NetBeans 9/harness
                            /home/sarah/Desktop/Home/Custom Programs/NetBeans 9/javafx
                            /home/sarah/Desktop/Home/Custom Programs/NetBeans 9/platform   Boot & Ext. Classpath   =    Application Classpath   = /home/sarah/Desktop/Home/Custom Programs/NetBeans 9/platform/lib/boot.jar:/home/sarah/Desktop/Home/Custom Programs/NetBeans 9/platform/lib/org-openide-modules.jar:/home/sarah/Desktop/Home/Custom Programs/NetBeans 9/platform/lib/org-openide-util.jar:/home/sarah/Desktop/Home/Custom Programs/NetBeans 9/platform/lib/org-openide-util-lookup.jar:/home/sarah/Desktop/Home/Custom Programs/NetBeans 9/platform/lib/org-openide-util-ui.jar   Startup Classpath       = /home/sarah/Desktop/Home/Custom Programs/NetBeans 9/platform/core/asm-all-5.0.1.jar:/home/sarah/Desktop/Home/Custom Programs/NetBeans 9/platform/core/core-base.jar:/home/sarah/Desktop/Home/Custom Programs/NetBeans 9/platform/core/core.jar:/home/sarah/Desktop/Home/Custom Programs/NetBeans 9/platform/core/org-netbeans-libs-asm.jar:/home/sarah/Desktop/Home/Custom Programs/NetBeans 9/platform/core/org-openide-filesystems-compat8.jar:/home/sarah/Desktop/Home/Custom Programs/NetBeans 9/platform/core/org-openide-filesystems.jar:/home/sarah/Desktop/Home/Custom Programs/NetBeans 9/nb/core/org-netbeans-upgrader.jar:/home/sarah/Desktop/Home/Custom Programs/NetBeans 9/nb/core/locale/core_nb.jar                     
-------------------------------------------------------------------------------                                                                                                           INFO [org.netbeans.modules.netbinox]: Install area set to file:/home/sarah/Desktop/Home/Custom Programs/NetBeans 9/              !SESSION 2018-08-01 08:57:53.947
-----------------------------------------------                                                                                                          eclipse.buildId=unknown                                                java.version=10.0.2                                                    java.vendor=Oracle Corporation                                         BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_GB         

                                                                                                                                                                                          !ENTRY org.eclipse.osgi 4 0 2018-08-01 08:57:53.956                    !MESSAGE Error reading configuration: Permission denied                !STACK 0                                                               java.io.IOException: Permission denied                                

        at java.base/java.io.UnixFileSystem.createFileExclusively(Native Method)
        at java.base/java.io.File.createTempFile(File.java:2090)
        at org.eclipse.osgi.storagemanager.StorageManager.initializeInstanceFile(StorageManager.java:188)
        at org.eclipse.osgi.storagemanager.StorageManager.open(StorageManager.java:708)
        at org.eclipse.osgi.internal.baseadaptor.BaseStorage.initFileManager(BaseStorage.java:226)
        at org.eclipse.osgi.internal.baseadaptor.BaseStorage.initialize(BaseStorage.java:160)
        at org.eclipse.osgi.baseadaptor.BaseAdaptor.initializeStorage(BaseAdaptor.java:123)
        at org.eclipse.osgi.framework.internal.core.Framework.<init>(Framework.java:192)
        at org.eclipse.osgi.framework.internal.core.EquinoxLauncher.internalInit(EquinoxLauncher.java:67)
        at org.eclipse.osgi.framework.internal.core.EquinoxLauncher.init(EquinoxLauncher.java:37)
        at org.eclipse.osgi.launch.Equinox.init(Equinox.java:178)
        at org.netbeans.modules.netbinox.Netbinox.init(Netbinox.java:61)
        at org.netbeans.core.netigso.Netigso.prepare(Netigso.java:145)
        at org.netbeans.NetigsoHandle.turnOn(NetigsoHandle.java:115)
        at org.netbeans.ModuleManager.enable(ModuleManager.java:1331)
        at org.netbeans.ModuleManager.enable(ModuleManager.java:1148)
        at org.netbeans.core.startup.ModuleList.installNew(ModuleList.java:315)
        at org.netbeans.core.startup.ModuleList.trigger(ModuleList.java:251)
        at org.netbeans.core.startup.ModuleSystem.restore(ModuleSystem.java:276)
        at org.netbeans.core.startup.Main.getModuleSystem(Main.java:156)
        at org.netbeans.core.startup.Main.getModuleSystem(Main.java:125)
        at org.netbeans.core.startup.Main.start(Main.java:282)
        at org.netbeans.core.startup.TopThreadGroup.run(TopThreadGroup.java:98)
        at java.base/java.lang.Thread.run(Thread.java:844) java.lang.RuntimeException: Permission denied
        at org.eclipse.osgi.framework.internal.core.Framework.<init>(Framework.java:194)
        at org.eclipse.osgi.framework.internal.core.EquinoxLauncher.internalInit(EquinoxLauncher.java:67)
        at org.eclipse.osgi.framework.internal.core.EquinoxLauncher.init(EquinoxLauncher.java:37)
        at org.eclipse.osgi.launch.Equinox.init(Equinox.java:178)
        at org.netbeans.modules.netbinox.Netbinox.init(Netbinox.java:61)
        at org.netbeans.core.netigso.Netigso.prepare(Netigso.java:145)
        at org.netbeans.NetigsoHandle.turnOn(NetigsoHandle.java:115)
        at org.netbeans.ModuleManager.enable(ModuleManager.java:1331)
        at org.netbeans.ModuleManager.enable(ModuleManager.java:1148)
        at org.netbeans.core.startup.ModuleList.installNew(ModuleList.java:315)
        at org.netbeans.core.startup.ModuleList.trigger(ModuleList.java:251)
        at org.netbeans.core.startup.ModuleSystem.restore(ModuleSystem.java:276)
        at org.netbeans.core.startup.Main.getModuleSystem(Main.java:156)
        at org.netbeans.core.startup.Main.getModuleSystem(Main.java:125)
        at org.netbeans.core.startup.Main.start(Main.java:282)
        at org.netbeans.core.startup.TopThreadGroup.run(TopThreadGroup.java:98)
        at java.base/java.lang.Thread.run(Thread.java:844) Caused by: java.io.IOException: Permission denied
        at java.base/java.io.UnixFileSystem.createFileExclusively(Native Method)
        at java.base/java.io.File.createTempFile(File.java:2090)
        at org.eclipse.osgi.storagemanager.StorageManager.initializeInstanceFile(StorageManager.java:188)
        at org.eclipse.osgi.storagemanager.StorageManager.open(StorageManager.java:708)
        at org.eclipse.osgi.internal.baseadaptor.BaseStorage.initFileManager(BaseStorage.java:226)
        at org.eclipse.osgi.internal.baseadaptor.BaseStorage.initialize(BaseStorage.java:160)
        at org.eclipse.osgi.baseadaptor.BaseAdaptor.initializeStorage(BaseAdaptor.java:123)
        at org.eclipse.osgi.framework.internal.core.Framework.<init>(Framework.java:192)
        ... 16 more

How can I either purge/reinstall the IDE or remove this requirement for root privileges? (System information in the top of the log)

2

There are 2 best solutions below

3
On

Try changing file ownership. Execute below commands

Open terminal and change directory to /home/sarah/Custom Programs/NetBeans 9/bin

sudo chmod +x netbeans.sh       #### hit enter and type the root password 

Now you have privilege to run netbeans.sh script file and install Netbeans in your system. To start installer wizard use below command within the same directory.

./netbeans    #### hit enter

Above command starts installer wizard and the Netbeans will be ready to install.

0
On

Delete the ~/.cache/netbeans and ~/.netbeans directories. Most likely, when you ran NetBeans as root it created root-owned cache files that your non-root user can't execute. Then start NetBeans as non-root user. This should recreate the cache files while preserving your settings.