Netbeans 9需要root特权才能运行吗?

时间:2018-08-01 13:11:18

标签: java netbeans netbeans-9

我拥有最新版本的Netbeans 9,并从名为netbeans的脚本中运行它。我认为这是一个安装程序脚本,并首次使用root特权运行了它,但这不是安装程序脚本,而是实际程序。

从此以后,似乎需要根特权才能运行,在没有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

如何清除/重新安装IDE或删除对root特权的此要求? (系统信息位于日志顶部)

2 个答案:

答案 0 :(得分:0)

尝试更改文件所有权。执行以下命令

打开终端并将目录更改为/home/sarah/Custom Programs/NetBeans 9/bin

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

现在,您有权运行netbeans.sh脚本文件并在系统中安装Netbeans。要启动安装程序向导,请在同一目录中使用以下命令。

./netbeans    #### hit enter

以上命令将启动安装程序向导,Netbeans将准备安装。

答案 1 :(得分:0)

删除〜/ .cache / netbeans和〜/ .netbeans目录。最有可能的是,当您以root用户身份运行NetBeans时,它会创建非root用户无法执行的root拥有的缓存文件。然后以非root用户身份启动NetBeans。这应该在保留设置的同时重新创建缓存文件。