如何编译保存?

问题描述 投票:3回答:3

我想在每次保存时编译项目,但在属性中这个选项是灰色的,所以对于任何更改,我必须单击save然后清理并构建。

如何避免为每个代码修改进行清理和构建?

netbeans save javafx-2
3个回答
2
投票

更改netbeans项目的project.properties,如下所示。

  1. 在project.properties文件中找到以下行 compile.on.save.unsupported.javafx =真
  2. 将此值更改为false compile.on.save.unsupported.javafx = FALSE
  3. 更改此文件后,将启用“保存时编译”选项,您可以继续使用。

0
投票

您应该从类别中选择源而不是构建。


0
投票

使用Maven回答Apache NetBeans 10(孵化here)。

配置在nbactions.xml文件中设置,通常它看起来类似于:

<?xml version="1.0" encoding="UTF-8"?>
<actions>
    <action>
        <actionName>run</actionName>
        <packagings>
            <packaging>war</packaging>
            <packaging>ear</packaging>
            <packaging>ejb</packaging>
        </packagings>
        <goals>
            <goal>package</goal>
        </goals>
    </action>
</actions>

要激活Compile On Save选项,您只需要添加设置为<netbeans.compile.on.save>all,它将如下所示:

<?xml version="1.0" encoding="UTF-8"?>
<actions>
    <action>
        <actionName>run</actionName>
        <packagings>
            <packaging>war</packaging>
            <packaging>ear</packaging>
            <packaging>ejb</packaging>
        </packagings>
        <goals>
            <goal>package</goal>
        </goals>
        <properties>
            <netbeans.compile.on.save>all</netbeans.compile.on.save>
        </properties>
    </action>
</actions>

也...

最新的NB 10和11你可能会在It is recommended to install nb-javac Library to improve Java editing experience and enable compile on save部分看到警告Notifications

enter image description here

您只需要通过单击该链接more info here来安装该插件。

© www.soinside.com 2019 - 2024. All rights reserved.