Difficulties with jpackage with a specific (Me) application written

I’m practicing and writing an application for working with video. I need to trim the video (And in the future take a frame from the moment in the video) but even at this stage I can’t package the application.

jpackage does not create and gives various errors, although when I try it on my other application, jpackage works fine

HelloApplication.java

package com.project;

import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.control.ProgressBar;
import javafx.scene.control.Slider;
import javafx.scene.layout.HBox;
import javafx.scene.layout.Priority;
import javafx.scene.layout.StackPane;
import javafx.scene.layout.VBox;
import javafx.scene.media.Media;
import javafx.scene.media.MediaPlayer;
import javafx.scene.media.MediaView;
import javafx.stage.FileChooser;
import javafx.stage.Stage;
import javafx.util.Duration;

import java.io.File;
import java.io.IOException;


public class HelloApplication extends Application {
    MediaPlayer mediaPlayer;
    MediaView mediaView;
    Media media;
    Label timeLabel;
    File file;

    private Duration startTime;
    private Duration endTime;

    @Override
    public void start(Stage stage) throws IOException {

        stage.setTitle("Hello!");
        stage.setWidth(1000);
        stage.setHeight(800);

        VBox generalBox = new VBox();
        HBox selecter = new HBox(10);
        Button buttonSelect = new Button("Выбрать");
        Label labelSelect = new Label("Не выбрано");

        selecter.getChildren().addAll(buttonSelect, labelSelect);

        VBox videoBox = new VBox();
        videoBox.setStyle("-fx-border-color: black; -fx-border-width: 2px;");
        VBox.setVgrow(videoBox, Priority.ALWAYS);

        StackPane videos = new StackPane();
        mediaView = new MediaView();
        videos.getChildren().add(mediaView);
        videoBox.getChildren().addAll(videos);
//--------------------------------
        VBox controllerBox = new VBox();
        controllerBox.setStyle("-fx-border-color: red; -fx-border-width: 2px;");

        HBox startBox = new HBox(10);
        startBox.setStyle("-fx-border-color: blue; -fx-border-width: 2px;");

        Button start = new Button("►");
        start.setDisable(true);

        startBox.getChildren().addAll(start);

        HBox timeLine = new HBox(10);
        timeLine.setStyle("-fx-border-color: green; -fx-border-width: 2px;");

        ProgressBar progressBar = new ProgressBar(0);
        progressBar.setPrefWidth(500);
        timeLabel = new Label("00:00:00");

        timeLine.getChildren().addAll(progressBar, timeLabel);

        HBox sliders = new HBox();
        sliders.setStyle("-fx-border-color: yellow; -fx-border-width: 2px;");
        Button leftOne = new Button("←");
        leftOne.setDisable(true);
        Button leftFive = new Button("←←");
        leftFive.setDisable(true);

        Slider slider = new Slider(0, 100, 0);
        slider.setPrefWidth(500);
        slider.setDisable(true);

        Button rightOne = new Button("→");
        rightOne.setDisable(true);
        Button rightFive = new Button("→→");
        rightFive.setDisable(true);

        sliders.getChildren().addAll(leftFive, leftOne, slider, rightOne, rightFive);

        HBox setterButton = new HBox(10);
        setterButton.setStyle("-fx-border-color: black; -fx-border-width: 2px;");
        Button startButton = new Button("Начало");
        startButton.setDisable(true);
        Label startLabel = new Label("00:00:00");

        Button endButton = new Button("Конец");
        endButton.setDisable(true);
        Label endLabel = new Label("00:00:00");

        Button pruning = new Button("Обрезать");
        pruning.setDisable(true);

        setterButton.getChildren().addAll(startButton, startLabel, endButton, endLabel, pruning);

        controllerBox.getChildren().addAll(startBox, timeLine, sliders, setterButton);
//----------------------------
        generalBox.getChildren().addAll(selecter, videoBox, controllerBox);

        Scene scene = new Scene(generalBox);
        stage.setScene(scene);
        stage.show();

//Обработчик кнопок
        buttonSelect.setOnAction(e -> {
            FileChooser chooser = new FileChooser();
            chooser.getExtensionFilters().add(new FileChooser.ExtensionFilter("Video Files", "*.mp4", "*.avi", "*.mkv"));
            file = chooser.showOpenDialog(stage);

            if(file != null){
                if(mediaPlayer != null){
                    mediaPlayer.dispose();
                }
                media = new Media(file.toURI().toString());
                mediaPlayer = new MediaPlayer(media);
                TimerVideo videoTimer = new TimerVideo(mediaPlayer, timeLabel);

                mediaPlayer.currentTimeProperty().addListener((observable, oldValue, newValue) -> {
                    Duration totalDuration = mediaPlayer.getTotalDuration();
                    if (totalDuration != null && !totalDuration.isUnknown()) {
                        double progress = newValue.toSeconds() / totalDuration.toSeconds();
                        progressBar.setProgress(progress);
                    }
                });

                mediaView.setMediaPlayer(mediaPlayer);
                mediaView.setFitHeight(600);
                mediaView.setFitWidth(300);
                mediaView.setPreserveRatio(true);
                labelSelect.setText("Выбрано "+ file.getAbsolutePath());
                start.setDisable(false);
                slider.setDisable(false);
                startButton.setDisable(false);
                endButton.setDisable(false);
                pruning.setDisable(false);
                rightFive.setDisable(false);
                rightOne.setDisable(false);
                leftFive.setDisable(false);
                leftOne.setDisable(false);

                mediaPlayer.currentTimeProperty().addListener((observable, oldValue, newValue) -> {
                    if (!slider.isValueChanging()) { // Проверяем, что пользователь не взаимодействует с слайдером
                        Duration totalDuration = mediaPlayer.getTotalDuration();
                        if (totalDuration != null && !totalDuration.isUnknown()) {
                            double progress = newValue.toSeconds() / totalDuration.toSeconds();
                            slider.setValue(progress * 100); // Обновляем слайдер (в процентах)
                        }
                    }
                    slider.valueChangingProperty().addListener((obs, wasChanging, isChanging) -> {
                        if (!isChanging) { // Когда пользователь отпускает слайдер
                            Duration totalDuration = mediaPlayer.getTotalDuration();
                            if (totalDuration != null) {
                                double newTime = slider.getValue() / 100 * totalDuration.toSeconds();
                                mediaPlayer.seek(Duration.seconds(newTime)); // Устанавливаем новую позицию воспроизведения
                            }
                        }
                    });

                });

            }

        });
        start.setOnAction(e -> {
            if(mediaPlayer.getStatus() == MediaPlayer.Status.PLAYING){
                mediaPlayer.pause();
                start.setText("❚❚");
            }else{
                mediaPlayer.play();
                start.setText("►");
            }

        });
        startButton.setOnAction(e ->{
            if(mediaPlayer != null){
                startTime = mediaPlayer.getCurrentTime();
                startLabel.setText(formatDuration(startTime));
            }
        });

        endButton.setOnAction(e -> {
            if(mediaPlayer != null){
                endTime = mediaPlayer.getCurrentTime();
                endLabel.setText(formatDuration(endTime));
            }
        });

        leftOne.setOnAction(e ->{
            double value = slider.getValue();
            Duration totalDuration = mediaPlayer.getTotalDuration();
            if(totalDuration != null) {
                slider.setValue(value - 1);
                double timeValue = slider.getValue() / 100 * totalDuration.toSeconds();
                mediaPlayer.seek(Duration.seconds(timeValue));
            }
        });
        leftFive.setOnAction(e ->{
            double value = slider.getValue();
            Duration totalDuration = mediaPlayer.getTotalDuration();
            if(totalDuration != null) {
                slider.setValue(value - 5);
                double timeValue = slider.getValue() / 100 * totalDuration.toSeconds();
                mediaPlayer.seek(Duration.seconds(timeValue));
            }
        });
        rightFive.setOnAction(e ->{
            double value = slider.getValue();
            Duration totalDuration = mediaPlayer.getTotalDuration();
            if(totalDuration != null) {
                slider.setValue(value + 5);
                double timeValue = slider.getValue() / 100 * totalDuration.toSeconds();
                mediaPlayer.seek(Duration.seconds(timeValue));
            }
        });
        rightOne.setOnAction(e ->{
            double value = slider.getValue();
            Duration totalDuration = mediaPlayer.getTotalDuration();
            if(totalDuration != null) {
                slider.setValue(value + 1);
                double timeValue = slider.getValue() / 100 * totalDuration.toSeconds();
                mediaPlayer.seek(Duration.seconds(timeValue));
            }
        });

        pruning.setOnAction(e -> {
            try {
                // Получаем startTime и endTime как Duration
                double startInSeconds = startTime.toMillis() / 1000.0; // Преобразуем миллисекунды в секунды
                double endInSeconds = endTime.toMillis() / 1000.0; // Преобразуем миллисекунды в секунды

                // Преобразуем путь к файлу в URI и генерируем новое имя для обрезанного видео
                String name = file.toURI().toString();
                String newName = Randoms.Randomizer();

                // Обрезаем видео с помощью VideoEditor
                VideoEditor.trimVideo(name, newName, startInSeconds, endInSeconds);
            } catch (IOException ex) {
                ex.printStackTrace();
            }
        });
    }

    public static void main(String[] args) {
        launch();
    }
    private String formatDuration(Duration duration) {
        long minutes = (long) duration.toMinutes();
        long seconds = (long) duration.toSeconds() % 60;
        long milliseconds = (long) (duration.toMillis() % 1000);

        // Форматируем строку в нужный формат: MM:SS:MS
        return String.format("%02d:%02d:%03d", minutes, seconds, milliseconds);
    }
}

module-info.java

module com.project {
    requires javafx.controls;
    requires javafx.fxml;
    requires javafx.media;

    requires org.controlsfx.controls;
    requires org.kordamp.bootstrapfx.core;

    opens com.project to javafx.fxml;
    exports com.project;
}

pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com</groupId>
    <artifactId>Project</artifactId>
    <version>1.0-SNAPSHOT</version>
    <name>Project</name>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <junit.version>5.10.2</junit.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.openjfx</groupId>
            <artifactId>javafx-controls</artifactId>
            <version>17.0.6</version>
        </dependency>
        <dependency>
            <groupId>org.openjfx</groupId>
            <artifactId>javafx-media</artifactId>
            <version>17.0.6</version> <!-- укажите вашу версию JavaFX, если она отличается -->
        </dependency>
        <dependency>
            <groupId>org.openjfx</groupId>
            <artifactId>javafx-fxml</artifactId>
            <version>17.0.6</version>
        </dependency>
        <dependency>
            <groupId>org.controlsfx</groupId>
            <artifactId>controlsfx</artifactId>
            <version>11.2.1</version>
        </dependency>
        <dependency>
            <groupId>org.kordamp.bootstrapfx</groupId>
            <artifactId>bootstrapfx-core</artifactId>
            <version>0.4.0</version>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-api</artifactId>
            <version>${junit.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-engine</artifactId>
            <version>${junit.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.13.0</version>
                <configuration>
                    <source>17</source>
                    <target>17</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.openjfx</groupId>
                <artifactId>javafx-maven-plugin</artifactId>
                <version>0.0.8</version>
                <executions>
                    <execution>
                        <!-- Default configuration for running with: mvn clean javafx:run -->
                        <id>default-cli</id>
                        <configuration>
                            <mainClass>com.project/com.project.HelloApplication</mainClass>
                            <launcher>app</launcher>
                            <jlinkZipName>app</jlinkZipName>
                            <jlinkImageName>app</jlinkImageName>
                            <noManPages>true</noManPages>
                            <stripDebug>true</stripDebug>
                            <noHeaderFiles>true</noHeaderFiles>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>
java.io.IOException: Command [light.exe, -nologo, -spdb, -ext, WixUtilExtension, -out, C:UsersvalisAppDataLocalTempjdk.jpackage5771419907643998597imageswin-exe.imageVideoSaver-0.0.1.msi, -sice:ICE27, -loc, C:UsersvalisAppDataLocalTempjdk.jpackage5771419907643998597configMsiInstallerStrings_en.wxl, -cultures:en-us, C:UsersvalisAppDataLocalTempjdk.jpackage5771419907643998597wixobjmain.wixobj, C:UsersvalisAppDataLocalTempjdk.jpackage5771419907643998597wixobjbundle.wixobj, C:UsersvalisAppDataLocalTempjdk.jpackage5771419907643998597wixobjui.wixobj] in C:UsersvalisAppDataLocalTempjdk.jpackage5771419907643998597imageswin-msi.imageVideoSaver exited with 297 

Additionally: I just somehow got the application installer working and assembled. (Although I didn’t change absolutely anything). But I noticed an error and had to rebuild the application and again it gives me this error code 👆

I tried different versions of jdk 14, 17 (different versions too). Probably the problem is specifically in my code.

New contributor

Игорь Арсёнов is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

10

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật