一间杂货铺~

03月 12

NetBeans相关问题


I. 标签文字过小

更换了4K显示器后,NetBeans各个标签上的文字实在是太小了,即便是调整了控制面板->显示->设置自定义文本大小(DPI),设置成了200%,也还是小得看着不舒服。

搜索了一下,找到了解决办法,记录之:

修改NetBeans安装目录下的etc\netbeans.conf,在netbeans_default_options对应的值中追加--fontsize 24(前面需要使用空格隔开),然后重启NetBeans

netbeans_default_options="-J-client -J-Xss2m -J-Xms32m -J-Dapple.laf.useScreenMenuBar=true -J-Dapple.awt.graphics.UseQuartz=true -J-Dsun.java2d.noddraw=true -J-Dsun.java2d.dpiaware=true -J-Dsun.zip.disableMemoryMapping=true --fontsize 24"

参见:

II. 在GlassFish中运行项目时,提示access denied

具体提示如下:

access denied ("java.net.SocketPermission" "localhost:1527" "listen,resolve")
java.security.AccessControlException: access denied ("java.net.SocketPermission" "localhost:1527" "listen,resolve")

解决方法:

找到jre目录,比如/Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/jre,进入该目录下的lib/security目录,找到java.policy并编辑(如果存在权限问题,就使用sudo),在grant {...}块中追加下面的内容:

permission java.net.SocketPermission "localhost:1527", "listen";

编辑后,内容如下:

grant {
        // Allows any thread to stop itself using the java.lang.Thread.stop()
        // method that takes no argument.
        // Note that this permission is granted by default only to remain
        // backwards compatible.
        // It is strongly recommended that you either remove this permission
        // from this policy file or further restrict it to code sources
        // that you specify, because Thread.stop() is potentially unsafe.
        // See the API specification of java.lang.Thread.stop() for more
        // information.
        permission java.lang.RuntimePermission "stopThread";

        // allows anyone to listen on dynamic ports
        permission java.net.SocketPermission "localhost:0", "listen";

        // "standard" properies that can be read by anyone

        permission java.util.PropertyPermission "java.version", "read";
        permission java.util.PropertyPermission "java.vendor", "read";
        permission java.util.PropertyPermission "java.vendor.url", "read";
        permission java.util.PropertyPermission "java.class.version", "read";
        permission java.util.PropertyPermission "os.name", "read";
        permission java.util.PropertyPermission "os.version", "read";
        permission java.util.PropertyPermission "os.arch", "read";
        permission java.util.PropertyPermission "file.separator", "read";
        permission java.util.PropertyPermission "path.separator", "read";
        permission java.util.PropertyPermission "line.separator", "read";

        permission java.util.PropertyPermission "java.specification.version", "read";
        permission java.util.PropertyPermission "java.specification.vendor", "read";
        permission java.util.PropertyPermission "java.specification.name", "read";

        permission java.util.PropertyPermission "java.vm.specification.version", "read";
        permission java.util.PropertyPermission "java.vm.specification.vendor", "read";
        permission java.util.PropertyPermission "java.vm.specification.name", "read";
        permission java.util.PropertyPermission "java.vm.version", "read";
        permission java.util.PropertyPermission "java.vm.vendor", "read";
        permission java.util.PropertyPermission "java.vm.name", "read";

        permission java.net.SocketPermission "localhost:1527", "listen";
};

参见:

III. 正在启动 Tomcat 进程...正在等待 Tomcat...

现象:运行某个项目时,已输出org.apache.catalina.startup.Catalina.start Server startup in xxx ms,但也提示

Deploying on Apache Tomcat 8.0.33
    profile mode: false
    debug mode: false
    force redeploy: true
正在启动 Tomcat 进程...
正在等待 Tomcat...
启动 Tomcat 失败。

如果通过运行Tomcat脚本,可以启动,但又出现了上面的现象,很可能就是NetBeans中设置了代理:

代理设置

将其设置为无代理就可以了。

标签:netbeans

还不快抢沙发

添加新评论