I am trying to create an .exe file from a -jar file the problem is i am using javafx-sdk-15.0.1 and jdk-15.0.1. For some reason when i use launch4j it wont open the newly created .exe. Can someone help me please. How do i incorporate these two things (javafx-sdk-15.0.1 and jdk-15.0.1) in the .exe.
Note: To run jar from CMD i use this-
java -jar --module-path C:\Users\PC\Desktop\javafx-sdk-15.0.1\lib --add-modules javafx.controls,javafx.fxml "C:\Users\PC\Desktop\Taco\Good Taco Shop.jar
I also put the JDK/bin in my path.
Thank You!!
Have a look at the relevant tools that come with your JDK. These are jpackage, jdeps and jlink. Here is a tutorial on how to use them: https://github.com/dlemmermann/JPackageScriptFX
Related
I have a problem that I cannot solve, When I run the executable of my program it gives me the following error:
The code executable cannot continue because libgcc_s_seh-1.dll was not found. To fix the problem, try reinstalling the program
I tried to manually copy and paste the file (libgcc_s_seh-1.dll) into the folder where I keep the executable but I get the following error:
The application could not be started correctly (0xc000007b)
Additional information:
I use windows 10 64 bit
I Use mingw81_64
I use version 6.1.2 of Qt
What can I solve the problem?
I guess you double-clicked in exe file that provides after building in release mode :
For Deploy and create Exe output with QT in windows you should follow this way:
put your compiler path in your system path. now you use mingw81_64 you should set it. something like Qt/tools/mingw81_64/bin
copy exe file that provides after building in release mode in one folder and run mingw81_64 cmd (it has separate cmd)
and cd to that folder path
windeployqt app.exe
This command will get all dll needs for your app and your exe will work .
if you use qml
windeployqt --qmldir (the path of its directory ) app.exe
and also see these youtube videos for more info:
https://www.youtube.com/watch?v=LdSTgR0xJco
https://www.youtube.com/watch?v=hCXAgB6y8eA
For specific error of libgcc_s_seh-1.dll was not found, please try to copy libgcc_s_seh-1.dll, libstdc++-6.dll, libwinpthread-1.dll into your compiler path like Qt/tools/mingw81_64/bin.
You should copy libgcc_s_seh-1.dll, libstdc++-6.dll, libwinpthread-1.dll into your exefile path after executing windeployqt.exe with all files are in correct version.
I am using javafxpackager to deploy a javaFX application, but it only generates a deb package, the command line I am using is this:
javafxpackager -deploy -native -outdir packages -outfile DebtRegister -srcdir out/artifacts/DebtRegister2_jar -srcfiles DebtRegister2.jar -appclass application.Main
I am using ubuntu and I do not wish to use windows for packaging.
Where is the mistake in my command?
First please note that the javafxpackager has been renamed to javapackager.
Regarding your question, please see the documentation:
all: Runs all of the installers for the platform on which it is
running, and creates a disk image for the application.
You will have to run javapackager on every supported platform.
I have no idea why, but when i export my java program into a Jar it just wont run. There are no errors when building or running it. When I run the program through eclipse it work perfectly.
Anyone had this problem before or care to take a look?
regards,
Matt
As Shark said, it has to be exported as an Executable JAR file. Just exporting your project to a JAR is insufficient.
Here's a nice write-up on making Executable JAR files:
http://www.mkyong.com/java/how-to-make-an-executable-jar-file/
If you want to make it from Eclipse, Export as Java | Runnable JAR.
windows 8 installed java 1.6 without the correct paths. I installed jdk 1.8 and it worked.
I have created a project within NetBeans with includes a form and a class that serves as a database connection layer. When i try to run this project through the IDE everything launches just fine. The problem occurs when i try to launch the jar file created by the ide on the commmand prompt terminal. nothing happens? it just moves to the next line. i have a manifest file with a class path and main class specified and it looks like so
Manifest-Version: 1.0
Ant-Version: Apache Ant 1.8.3
Created-By: 1.6.0_22-b04 (Sun Microsystems Inc.)
Class-Path: lib/mysql-connector-java-5.1.13-bin.jar lib/mylib.jar
X-COMMENT: Main-Class will be added automatically by build
Main-Class: eopprototype.EOPPrototype
when i look at what the compiler says is says To run this application from the command line without Ant, try:
java -jar "/h/USERS/local/pagola/NetBeansProjects/EOPPrototype/dist/EOPPrototype.jar"
when i try to type that command it just goes to the second line without anything happening. Not evena ny errors. I am supposed to distribute this jar file to a shared folder and have it run but i cant do it and i dont know whats wrong. I have NOT added any JAVA_HOME path as my jdk 1,6 is isntalled in usr/bin so it should find it there but i have NOT added any classpath (ide shows two runtime and bootable classpaths) somebody please assist me as i am new to the whole java virtual machine environment
I guess you meant the standard outputs, or other things you printed to the command prompt from your java program. To get that printed on the command propmt, you need to run java in debug mode.
Use
java -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005 -jar myJar.jar
to run java in debug mode and get all standard outputs, exceptions etc. on the command prompt.
i want to know how to make a jar app which will run on java mobile platform using class file of java.
i know basics of java like inheritance,interface,string.....I tried this thing by compiling my java program of simple input/output and then converting it to jar using -jar in cmd.but i dont know why it is not working on mobile showing invalid file.
plz help me.
If you want to create a jar application, starting from a java class,you don't have to use java -jar filename.jar, this is only for execution.
Try this: jar cf your_jar_app.jar your_class_file.class
c option is needed to create file and f option is needed because you want an output file.
Then you can execute typing: java -jar your_jar_app.jar
Hope this can help you.
For documentation: Oracle Documentation for creating JAR file
If you are using NetBeans IDE, take a look to: NetBeans Packaging and Deploying Java Applications