Menu

Building a JFX Project under Linux with Maven

Help
2009-01-30
2013-04-22
  • Paul PODGORSEK

    Paul PODGORSEK - 2009-01-30

    Hi,

    I am currently working on my own SourceForge project (JavaFX Picture Viewer), and have started using your compiler component with Maven.

    When I try to build my project, here is the error that I get:
    [code]
    [ERROR] BUILD FAILURE
    [INFO] ------------------------------------------------------------------------
    [INFO] Compilation failure

    /home/paul/workspace/jfxpictureview/jfxpictureview-main/src/main/java/org/jfxpictureview/display/PictureListScrollPane.fx:[1,0] cannot access javafx.lang.Builtins
    class file for javafx.lang.Builtins not found
    package org.jfxpictureview.display;
    [/code]

    After that line, I have errors on all the imports inside my JFX sources.

    And here is my POM:
    [code]
    <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

        <modelVersion>4.0.0</modelVersion>

        <groupId>org.jfxpictureview</groupId>
        <artifactId>jfxpictureview</artifactId>
        <version>1.0-SNAPSHOT</version>
        <packaging>pom</packaging>

        <name>JavaFX Picture Viewer</name>
        <description></description>
        <developers>
            <developer>
                <id>paul_podgorsek</id>
                <name>Paul PODGORSEK</name>
                <email>paul_podgorsek@hotmail.com</email>
            </developer>
        </developers>

        <scm>
            <developerConnection>scm:svn:https://jfxpictureview.svn.sourceforge.net/svnroot/jfxpictureview/trunk</developerConnection>
        </scm>

        <repositories>
            <repository>
                <id>central</id>
                <name>Maven Central</name>
                <url>http://repo1.maven.org/maven2</url>
                <snapshots>
                    <enabled>false</enabled>
                </snapshots>
            </repository>
            <repository>
                <id>central2</id>
                <name>Maven Central 2</name>
                <url>http://repo2.maven.org/maven2</url>
                <snapshots>
                    <enabled>false</enabled>
                </snapshots>
            </repository>
            <repository>
                <id>jfxpictureview-repo</id>
                <name>JFX Picture Viewer Repository</name>
                <url>http://jfxpictureview.sourceforge.net/jfxpictureview-repo</url>
                <releases>
                    <enabled>false</enabled>
                </releases>
            </repository>
        </repositories>

        <pluginRepositories>
            <pluginRepository>
                <id>m2-javafxc</id>
                <name>Sourceforge M2-javafxc static repo</name>
                <url>http://m2-javafxc.sourceforge.net/m2repo</url>
            </pluginRepository>
        </pluginRepositories>

        <properties>
            <encoding>UTF-8</encoding>

            <!-- maven -->
            <maven-eclipse.version>2.6.patched-20081118</maven-eclipse.version>
            <maven-install.version>2.2</maven-install.version>
            <maven-source.version>2.0.4</maven-source.version>
            <maven-resources.version>2.3</maven-resources.version>
            <maven-compiler.version>2.0.2</maven-compiler.version>
            <maven-archetype.version>2.0-alpha-4</maven-archetype.version>
            <maven-site.version>2.0-beta-7</maven-site.version>
            <maven-surefire.version>2.4.3</maven-surefire.version>
            <maven-release.version>2.0-beta-8</maven-release.version>
            <maven-surefire-report>2.4.3</maven-surefire-report>
            <maven-cobertura.version>2.2</maven-cobertura.version>
            <maven-changes.version>2.0-beta-3</maven-changes.version>

            <!-- JavaFX -->
            <javafxc.version>1.0-SNAPSHOT</javafxc.version>
            <javafxrt.version>1.0-SNAPSHOT</javafxrt.version>
            <scenario.version>0.6-SNAPSHOT</scenario.version>
            <m2javafxc.version>0.1-SNAPSHOT</m2javafxc.version>

            <!-- test -->
            <junit.version>4.4</junit.version>
        </properties>

        <modules>
            <module>jfxpictureview-main</module>   
        </modules>

        <dependencyManagement>
            <dependencies>
                <dependency>
                    <groupId>org.jfxpictureview</groupId>
                    <artifactId>jfxpictureview-main</artifactId>
                    <version>${pom.version}</version>
                </dependency>
            </dependencies>
        </dependencyManagement>

        <build>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-install-plugin</artifactId>
                    <version>${maven-install.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>${maven-source.version}</version>
                    <executions>
                        <execution>
                            <id>attach-sources</id>
                            <goals>
                                <goal>jar</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>${maven-resources.version}</version>
                    <configuration>
                        <encoding>${encoding}</encoding>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <configuration>
                        <compilerId>javafxc</compilerId>
                        <include>**/*.fx</include>
                        <compilerArguments>
                            <jfxHome>false</jfxHome>
                        </compilerArguments>
                    </configuration>
                    <dependencies>               
                        <dependency>
                            <groupId>net.sf.m2javafxc</groupId>
                            <artifactId>plexus-compiler-javafxc</artifactId>
                            <version>${m2javafxc.version}</version>
                        </dependency>
                        <dependency>
                            <groupId>net.java.dev.openjfx</groupId>
                            <artifactId>javafxc</artifactId>
                            <version>${javafxc.version}</version>
                        </dependency>
                        <dependency>
                            <groupId>net.java.dev.openjfx</groupId>
                            <artifactId>javafxrt</artifactId>
                            <version>${javafxrt.version}</version>
                        </dependency>
                        <dependency>
                            <groupId>net.java.dev.openjfx</groupId>
                            <artifactId>Scenario</artifactId>
                            <version>${scenario.version}</version>
                        </dependency>
                    </dependencies>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-archetype-plugin</artifactId>
                    <version>${maven-archetype.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-site-plugin</artifactId>
                    <version>${maven-site.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>${maven-surefire.version}</version>
                </plugin>
                <plugin>
                    <artifactId>maven-release-plugin</artifactId>
                    <version>${maven-release.version}</version>
                    <configuration>
                        <tagBase>https://jfxpictureview.svn.sourceforge.net/svnroot/jfxpictureview/tags</tagBase>
                    </configuration>
                </plugin>
            </plugins>
        </build>

        <reporting>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-report-plugin</artifactId>
                    <version>${maven-surefire-report}</version>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>cobertura-maven-plugin</artifactId>
                    <version>${maven-cobertura.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-changes-plugin</artifactId>
                    <version>${maven-changes.version}</version>
                    <reportSets>
                        <reportSet>
                            <reports>
                                <report>changes-report</report>
                            </reports>
                        </reportSet>
                    </reportSets>
                </plugin>
            </plugins>
        </reporting>

        <profiles>
            <profile>
                <id>LOCAL</id>
                <activation>
                    <activeByDefault>true</activeByDefault>
                </activation>
                <build>
                    <filters>
                        <filter>src/main/filters/LOCAL.properties</filter>
                    </filters>
                    <resources>
                        <resource>
                            <directory>src/main/resources</directory>
                            <filtering>false</filtering>
                        </resource>
                        <resource>
                            <directory>src/main/filtered-resources</directory>
                            <filtering>true</filtering>
                        </resource>
                    </resources>
                </build>
            </profile>
        </profiles>

    </project>
    [/code]

    It seems that javafxc is correctly downloaded as, if I have a syntax error, it is found. Problems only occur when the compiler really tries to build the project.
    Do you know if it could be because the compiler can't find javafxrt or Scenario?

    I have also read that there where problems for people trying to do JFX on Linux systems. As I am working on a Fedora computer, do you think that could be the problem?

    Thanks for having read down to here! And thank you very much if you know the solution to my problem! :-)

    Paul.

     
    • Aliaksandr Zinevich

      Paul, could you, please, resend your post and POM file(s) as attachment to the mailing list m2-javafxc-develop@lists.sourceforge.net -- there is small number of questions asking by people -- so for now all questions are welcomed in mail list and I could react promptly...
      it seems you've lost formatting... With formatting it will be much easier to read it (not only for me, but for others).

      I will try to "dig" in it anyway.

       
    • Aliaksandr Zinevich

      Your mistake I guess is that you misplaced:
      <dependency>
      <groupId>net.java.dev.openjfx</groupId>
      <artifactId>javafxrt</artifactId>
      <version>${javafxrt.version}</version>
      </dependency>
      <dependency>
      <groupId>net.java.dev.openjfx</groupId>
      <artifactId>Scenario</artifactId>
      <version>${scenario.version}</version>
      </dependency>

      It should be in
      <dependencyManagement>  or in dependecies of artifact "org.jfxpictureview:jfxpictureview-main:${pom.version}"

      Note your dependency to "net.java.dev.openjfx:javafxc" is correct.

       
    • Paul PODGORSEK

      Paul PODGORSEK - 2009-02-02

      As asked, this thread continues on the m2-javafxc-develop mailing list...

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.