在IdeaUIDesigner中的Lambda表达式和Java 1.8 [英] Lambda expressions and Java 1.8 in IdeaUIDesigner

查看:220
本文介绍了在IdeaUIDesigner中的Lambda表达式和Java 1.8的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用带有 Idea UI Designer 的lambda表达式的 Java 1.8 ,我在maven中:

I'm trying to use Java 1.8 with lambda expressions with Idea UI Designer, I have in maven:

<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>ideauidesigner-maven-plugin</artifactId>
    <executions>
        <execution>
            <goals>
                <goal>javac2</goal>
            </goals>
        </execution>
    </executions>

    <configuration>
        <fork>true</fork>
        <debug>true</debug>
        <failOnError>true</failOnError>
    </configuration>
</plugin>

和依赖

<dependency>
    <groupId>com.intellij</groupId>
    <artifactId>forms_rt</artifactId>
    <version>7.0.3</version>
</dependency>

当我尝试使用lambdas时,它返回编译错误:

When I try to use lambdas it returns compile error:

Failed to execute goal org.codehaus.mojo:ideauidesigner-maven-plugin:1.0-beta-1:javac2 (default) on project stockbox-chart: Execution default of goal org.codehaus.mojo:ideauidesigner-maven-plugin:1.0-beta-1:javac2 failed: 52264 -> [Help 1]

您对如何使用lambdas有任何想法吗? UI设计器

推荐答案

一种解决方法,直到有人能够修复插件为止,是配置IntelliJ设置以生成GUI作为源而不是二进制文件,然后在GUI设计器中进行更改时,手动重新生成之前之前的GUI源以运行Maven:

One workaround, until such time as someone is able to fix the plugin, is to configure your IntelliJ settings to generate the GUI as source rather than as binaries, then manually re-generate the GUI sources prior to running Maven any time you make a change in GUI designer:


  1. 转到文件>设置,然后将编辑器> GUI设计器>生成GUI的选项更改为: Java源代码

  2. 每当进行GUI更改时,从IntelliJ构建项目(重新)生成GUI Java源代码(构建>>构建项目)。

  3. 可选地,将生成的源检查为您正在使用的任何源控制机制;这一步节省了通过Maven构建项目的其他人以后必须从IntelliJ进行手动构建(即他们只能通过Maven构建)。

  4. 如果你使用的是IntelliJ布局manager(比如 GridLayoutManager ),在<$中添加 com.intellij:forms_rt:7.0.3 作为编译依赖项c $ c> pom.xml ,如果它还没有。

  5. 像往常一样运行Maven来构建你的项目。

  1. Go to File > Settings and change the selection for Editor > GUI Designer > Generate GUI into: to Java source code.
  2. Whenever you make a GUI change, build the project from IntelliJ to (re-)generate the GUI Java source code (Build >> Build Project).
  3. Optionally, check the generated source into whatever source-control mechanism you're using; this step saves anyone else building your project via Maven from having to do the manual build from IntelliJ later (i.e. so they can build solely via Maven).
  4. If you're using an IntelliJ layout manager (like GridLayoutManager), add com.intellij:forms_rt:7.0.3 as a compile dependency in your pom.xml, if it isn't already there.
  5. Run Maven as usual to build your project.

这篇关于在IdeaUIDesigner中的Lambda表达式和Java 1.8的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆