0

I try to compile the program on my raspberry pi with command mvn package when I am in project folder. I got an error with package javafx.___ does not exists. Down is the error and the pom file. If you have any idea please help me! I search for hours for solving this problem but I didn't fount anything

<?xml version="1.0" encoding="UTF-8"?>

http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0

<groupId>me.razvan.com</groupId>
<artifactId>PiProgramTest</artifactId>
<version>1.0-SNAPSHOT</version>

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-jar-plugin</artifactId>
            <version>3.1.0</version>
            <configuration>
                <archive>
                    <manifest>
                        <addClasspath>true</addClasspath>
                        <classpathPrefix>lib/</classpathPrefix>
                        <mainClass>me.razvan.com.Main</mainClass>
                    </manifest>
                </archive>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-shade-plugin</artifactId>
            <version>1.6</version>
            <executions>
                <execution>
                    <phase>package</phase>
                    <goals>
                        <goal>shade</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
        <plugin>
            <groupId>com.zenjava</groupId>
            <artifactId>javafx-maven-plugin</artifactId>
            <version>8.8.3</version>
            <configuration>
                <mainClass>me.razvan.com.Main</mainClass>
            </configuration>
        </plugin>
    </plugins>
</build>

<repositories>
    <repository>
        <id>oss-snapshots-repo</id>
        <name>Sonatype OSS Maven Repository</name>
        <url>https://oss.sonatype.org/content/groups/public</url>
        <snapshots>
            <enabled>true</enabled>
            <updatePolicy>always</updatePolicy>
        </snapshots>
    </repository>
</repositories>

<dependencies>
    <dependency>
        <groupId>com.pi4j</groupId>
        <artifactId>pi4j-core</artifactId>
        <version>1.2-SNAPSHOT</version>
    </dependency>

    <dependency>
        <groupId>com.jfoenix</groupId>
        <artifactId>jfoenix</artifactId>
        <version>8.0.7</version>
    </dependency>
</dependencies>

This is the error: https://hastebin.com/ocozuqiluz.sql

T. Razvan
  • 21
  • 3
  • What Java version are you using? Did you install JavaFX? – José Pereda Oct 27 '18 at 15:05
  • I use jdk8 and Yes I install JavaFX if this is the command: sudo apt-get install openjfx – T. Razvan Oct 27 '18 at 16:20
  • That won’t work I believe as that will be for Linux, not for Arm. Try this [answer](https://stackoverflow.com/a/38363136/3956070) – José Pereda Oct 27 '18 at 16:41
  • I have this installed as well and still not working. I do my program on pc (Windows) I build the project and I got no errors when I copy the project files on my raspberry pi and compile them I got that error and I have no idea what to fix it! – T. Razvan Oct 27 '18 at 16:44
  • Make sure JavaFX is installed correctly (try a simple test) and then make sure your Maven project is using the same Java version with JavaFX (see JAVA_HOME) – José Pereda Oct 27 '18 at 16:53
  • Yeah It is installed I reinstall my raspbian too. I make a simple test and still not working. – T. Razvan Oct 27 '18 at 18:26
  • If you create a HelloFX class (just an Application class that shows a scene), can you compile from your Raspberry, without Maven? If you can’t something is wrong with your setup – José Pereda Oct 27 '18 at 18:30
  • I still got the error package javafx. does not exist Do you have discord so we can text there. – T. Razvan Oct 27 '18 at 19:00
  • Why are you using `com.pi4j` as a SNAPSHOT version? – khmarbaise Oct 28 '18 at 07:51
  • The release version doesn't work for me, I have no problem with it, I try a program without javafx and works fine.I have a Raspberry PI 3 Model B+ – T. Razvan Oct 28 '18 at 10:52

0 Answers0