Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Lambda expressions and Java 1.8 in IdeaUIDesigner

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>

and dependency

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

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]

Do you have any ideas how to use lambdas with Idea UI Designer?

like image 266
Michał Jurczuk Avatar asked Aug 21 '15 07:08

Michał Jurczuk


1 Answers

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. 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.
like image 67
sumitsu Avatar answered Oct 12 '22 23:10

sumitsu