Home > Back-end >  Springboot deployment headaches when combined use modular import deployment headaches. The graphics
Springboot deployment headaches when combined use modular import deployment headaches. The graphics

Time:12-05

1. Problem description
I want to use springboot + deployment headaches. Write desktop applications, but at the beginning of a building project appear problem,
According to the online tutorial to build good environment after startup project will complain you need to import the deployment headaches. The graphics module,
I according to the content of the error prompt in module - info. Java import the module before you start the program, the error null pointer exception,
Online really very little information about deployment headaches, encounter problems to search very hard, don't know which leaders met the question, comment, thank you very much!
2, the code
This is a modular file
 module commclient. Spring {
Exports com.ut.com McLient;
The requires deployment headaches. Controls;
The requires deployment headaches. Base;
The requires deployment headaches. Graphics;
The requires springboot. Deployment headaches. Support;
The requires spring. The boot. Autoconfigure;
The requires deployment headaches. FXML;
The requires lombok;
}

3, the error message
 Exception Application in the init method 
Java. Lang. Reflect. InvocationTargetException
The at Java. The base/JDK. Internal. Reflect. NativeMethodAccessorImpl. Invoke0 (Native Method)
The at Java. The base/JDK. Internal. Reflect. NativeMethodAccessorImpl. Invoke (NativeMethodAccessorImpl. Java: 62)
The at Java. The base/JDK. Internal. Reflect. DelegatingMethodAccessorImpl. Invoke (43) DelegatingMethodAccessorImpl. Java:
The at Java. The base/Java. Lang. Reflect. Method. Invoke (564) Method. The Java:
At deployment headaches. Graphics/com. Sun. Deployment headaches. Application. LauncherImpl. LaunchApplicationWithArgs (LauncherImpl. Java: 464)
At deployment headaches. Graphics/com. Sun. Deployment headaches. Application. LauncherImpl. LaunchApplication (LauncherImpl. Java: 363)
The at Java. The base/JDK. Internal. Reflect. NativeMethodAccessorImpl. Invoke0 (Native Method)
The at Java. The base/JDK. Internal. Reflect. NativeMethodAccessorImpl. Invoke (NativeMethodAccessorImpl. Java: 62)
The at Java. The base/JDK. Internal. Reflect. DelegatingMethodAccessorImpl. Invoke (43) DelegatingMethodAccessorImpl. Java:
The at Java. The base/Java. Lang. Reflect. Method. Invoke (564) Method. The Java:
At Java. The base/sun. The launcher. LauncherHelper $FXHelper. Main (1051) LauncherHelper. Java:
Under Caused by: Java. Lang. RuntimeException: Exception Application in the init method
At deployment headaches. Graphics/com. Sun. Deployment headaches. Application. LauncherImpl. LaunchApplication1 (LauncherImpl. Java: 895)
At deployment headaches. Graphics/com. Sun. Deployment headaches. Application. LauncherImpl. Lambda $launchApplication $2 (195) LauncherImpl. Java:
At Java. The base/Java. Lang. Thread. The run (832) Thread. Java:
Under Caused by: Java. Lang. NullPointerException
The at [email protected]/DE felixroske. Jfxsupport. AbstractJavaFxApplicationSupport. LoadDefaultIcons (AbstractJavaFxApplicationSupport. Java: 362)
At [email protected]/DE felixroske. Jfxsupport. AbstractJavaFxApplicationSupport. Init (AbstractJavaFxApplicationSupport. Java: 122)
At deployment headaches. Graphics/com. Sun. Deployment headaches. Application. LauncherImpl. LaunchApplication1 (LauncherImpl. Java: 824)
. 2 more
The Exception running application com.ut.commclient.Com mClientApplication

CodePudding user response:

JDK version?

Jdk8 used directly, jdk9 separation after deployment headaches, requires a separate deployment headaches - SDK installed, and then use the command line to start the application deployment headaches

Java jar - the module - the path "C: \ deployment headaches - SDK - 11.0.2 \ lib" -- add - modules=deployment headaches. Controls, deployment headaches. Web, deployment headaches. FXML mygui - 0.0.1 - the SNAPSHOT. The jar

CodePudding user response:

reference 1st floor tianfang response:
JDK version?

Jdk8 used directly, jdk9 separation after deployment headaches, requires a separate deployment headaches - SDK installed, and then use the command line to start the application deployment headaches

Java jar - the module - the path "C: \ deployment headaches - SDK - 11.0.2 \ lib" -- add - modules=deployment headaches. Controls, deployment headaches. Web, deployment headaches. FXML mygui - 0.0.1 - the SNAPSHOT. Jar


Hello, JDK14, deployment headaches - SDK is 14, the way you mentioned I had tried before, in this way does not write the module - info. Java file, then it wouldn't cause I met problems,
But according to this method, the program after packaging, every time I start the program need to manually set the VM arguments, I feel it is too much trouble, and users to use too uncomfortable,
After may have a way to let a package for a program, start the program doesn't have to manually enter the VM parameters every time? And how to deal with the lib path?

CodePudding user response:

You can try using exe4j directly into an exe file

CodePudding user response:

reference 5 floor tianfang reply:
, you can try using exe4j directly into an exe file

This software is a cross-platform, exe format in the Linux environment is not installed or extra running exe, additional installation running environment is too redundant

CodePudding user response:

refer to 6th floor Triple_HHH3 response:
Quote: refer to the fifth floor tianfang reply:
, you can try using exe4j directly into an exe file

The software, is a cross-platform, exe format in the Linux environment is not installed or extra running exe, additional installation running environment is too redundant


Also is to use the native language to generate an executable file, execute the script,

CodePudding user response:

refer to 7th floor tianfang response:
Quote: refer to the sixth floor Triple_HHH3 response:
Quote: refer to fifth floor tianfang response:
, you can try using exe4j directly into an exe file

The software, is a cross-platform, exe format in the Linux environment is not installed or extra running exe, additional installation running environment is too redundant


Also is to use the native language to generate an executable file, execute the script,

I also thought of this method, but to run on Windows and Linux operation, you need to write down the two scripts, the script is simple, write two or slightly multifarious, it is better to change numerous for brief, with the module - info. Java
  • Related