Contenu | Rechercher | Menus

Annonce

Si vous avez des soucis pour rester connecté, déconnectez-vous puis reconnectez-vous depuis ce lien en cochant la case
Me connecter automatiquement lors de mes prochaines visites.

À propos de l'équipe du forum.

#1 Le 02/01/2024, à 00:29

Pfiouu

java et javaFx

Bonjour Bonsoir
Je sais pas par ou commencer pour exposer mon souci puisque j'y connais rien et que je me suis dis «c'est sympa linux, vas y mon champion, tu vas réussir à faire un truc en java pour mettre des sortes de ballons autour des gens
oui, une zone personnelle
Donc je vois qu'il faut java et javaFx
et ensuite....je sais pas
java -version
openjdk version "21.0.1" 2023-10-17 LTS
OpenJDK Runtime Environment Temurin-21.0.1+12 (build 21.0.1+12-LTS)
OpenJDK 64-Bit Server VM Temurin-21.0.1+12 (build 21.0.1+12-LTS, mixed mode, sharing)
et Maven d'installé

Je commence par donner quoi comme info pour m'en sortir?

Hors ligne

#2 Le 02/01/2024, à 16:18

Pfiouu

Re : java et javaFx

jean-guillaume@hal:~/MonProjetJavaFX$ mvn clean compile

[INFO] Scanning for projects...
[INFO] 
[INFO] -----------------------< projetAura:projetAura >------------------------
[INFO] Building projetAura 1.0-SNAPSHOT
[INFO]   from pom.xml
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- clean:3.2.0:clean (default-clean) @ projetAura ---
[INFO] Deleting /home/jean-guillaume/MonProjetJavaFX/target
[INFO] 
[INFO] --- resources:3.2.0:resources (default-resources) @ projetAura ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Using 'UTF-8' encoding to copy filtered properties files.
[INFO] skip non existing resourceDirectory /home/jean-guillaume/MonProjetJavaFX/src/main/resources
[INFO] 
[INFO] --- compiler:3.11.0:compile (default-compile) @ projetAura ---
[INFO] Nothing to compile - all classes are up to date
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  1.919 s
[INFO] Finished at: 2024-01-02T15:12:26+01:00

jean-guillaume@hal:~/MonProjetJavaFX$ mvn javafx:run

[INFO] Scanning for projects...
[INFO] 
[INFO] -----------------------< projetAura:projetAura >------------------------
[INFO] Building projetAura 1.0-SNAPSHOT
[INFO]   from pom.xml
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] >>> javafx:0.0.7:run (default-cli) > process-resources @ projetAura >>>
[INFO] 
[INFO] --- resources:3.2.0:resources (default-resources) @ projetAura ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Using 'UTF-8' encoding to copy filtered properties files.
[INFO] skip non existing resourceDirectory /home/jean-guillaume/MonProjetJavaFX/src/main/resources
[INFO] 
[INFO] <<< javafx:0.0.7:run (default-cli) < process-resources @ projetAura <<<
[INFO] 
[INFO] 
[INFO] --- javafx:0.0.7:run (default-cli) @ projetAura ---
[INFO] Scanning for projects...
[INFO] 
[INFO] -----------------------< projetAura:projetAura >------------------------
[INFO] Building projetAura 1.0-SNAPSHOT
[INFO]   from modifiedPom.xml
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] >>> javafx:0.0.7:dorun (default-cli) > process-classes @ projetAura >>>
[INFO] 
[INFO] --- resources:3.2.0:resources (default-resources) @ projetAura ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Using 'UTF-8' encoding to copy filtered properties files.
[INFO] skip non existing resourceDirectory /home/jean-guillaume/MonProjetJavaFX/src/main/resources
[INFO] 
[INFO] --- compiler:3.11.0:compile (default-compile) @ projetAura ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] <<< javafx:0.0.7:dorun (default-cli) < process-classes @ projetAura <<<
[INFO] 
[INFO] 
[INFO] --- javafx:0.0.7:dorun (default-cli) @ projetAura ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  2.105 s
[INFO] Finished at: 2024-01-02T15:13:45+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.openjfx:javafx-maven-plugin:0.0.7:dorun (default-cli) on project projetAura: Error: Error: Output directory is empty -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  7.060 s
[INFO] Finished at: 2024-01-02T15:13:45+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.openjfx:javafx-maven-plugin:0.0.7:run (default-cli) on project projetAura: Error, javafx:run failed -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

jean-guillaume@hal:~/MonProjetJavaFX$ ls

ChampsMorphiquesVisualisation.class  pom.xml  target
ChampsMorphiquesVisualisation.java   src

pom.xml

<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/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>projetAura</groupId>
    <artifactId>projetAura</artifactId>
    <version>1.0-SNAPSHOT</version>

    <properties>
        <javafx.version>17</javafx.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    </properties>

    <!-- Ajout de la section build -->
    <build>
        <outputDirectory>${project.build.directory}/classes</outputDirectory>
        <plugins>
            <plugin>
                <groupId>org.openjfx</groupId>
                <artifactId>javafx-maven-plugin</artifactId>
                <version>0.0.7</version>
                <configuration>
                    <mainClass>ChampsMorphiquesVisualisation</mainClass>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.11.0</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <version>3.2.0</version>
                <configuration>
                    <encoding>UTF-8</encoding>
                </configuration>
            </plugin>
        </plugins>
    </build>
    <!-- Fin de la section build -->

    <!-- Le reste de votre fichier pom.xml -->
</project>

ChampsMorphiquesVisualisation

import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.layout.Pane;
import javafx.scene.paint.Color;
import javafx.scene.shape.Circle;
import javafx.stage.Stage;

public class ChampsMorphiquesVisualisation extends Application {
    public static void main(String[] args) {
        launch(args);
    }

    @Override
    public void start(Stage primaryStage) {
        primaryStage.setTitle("Champs Morphiques Visualisation");
        Pane root = new Pane();

        // Ajoutez des cercles ou d'autres formes pour représenter les "champs morphiques"
        Circle champMorphique1 = new Circle(100);
        champMorphique1.setFill(Color.BLUE);

        Circle champMorphique2 = new Circle(150);
        champMorphique2.setFill(Color.RED);

        root.getChildren().addAll(champMorphique1, champMorphique2);

        Scene scene = new Scene(root, 300, 300);
        primaryStage.setScene(scene);
        primaryStage.show();
    }
}

Hors ligne