I made a desktop application with Java netbeans, it's a Jframe with some components. I built it and the .jar file created in the dist folder in the project folder. I have already the jre (Java Runtime Environment) installed on my pc. When I try to open the .jar with the jre I got nothing, Nothing appears. What can I do ?
https://netbeans.org/kb/articles/javase-deploy.html#Exercise_1
The link above will take you to a tutorial. Jar files are not executable by default. You need to specify a starting class to make a jar file executable.
If this doesn't work, then make sure you have called setVisible(true) on your JFrame.
Edited to add: (author added info)
When I try to run through CMD there's Unsupported major.minor version 52.0
This means your JRE version does not match your compiler version. You can confirm with the -version option, then fix your path to use Java from the same place your compiler lives.
Related
I installed the last JDK from this website (Java SE 14.0.2). This installed both jdk14.0.2 and jre1.8.0_231 in the java folder of my Program Files folder.
I want to make a .exe file out of my jar files using Launch4j however, I can't run Launch4j because everytime I try, it says it requires a java runtime environment. I'm confused because I should already have one installed (jre1.8.0_231), so why isn't it recognizing that?
I created a project in eclipse and want to run my exported .jar file on an other machine. When I try to do so using "java -jar myfile.jar", I get the following message:
Error: JavaFX runtime components are missing, and are required to run this application
If I run it in eclipse (using jdk13), everything works.
On the machine where I want to run the jar file I installed openjdk and openjfx. Actually I'm not sure wether the problem has to be solved in eclipse while exporting the jar file or on the other machine while running it? And how? May anyone give me a hint?
I am building an installer for a JavaFX 1.8 Windows application.
This application contains a JNI.
When I run the Ant script with the jdk 1.8.0_172, files named api-ms-win-core-*.dll and ucrtbase.dll are copied to the runtime\bin install directory. Those files are not present when I run the exact same script with jdk 1.8.0_144.
I have tested my program without those files and it works fine. What could be a path to investigate to understand how to get rid of those files?
Also, msvcp120.dll is updated to msvcp140.dll and vcruntime140.dll file appears (and is needed).
Thanks!
I'm looking to make a jar file out some Java code using jar [options] [name] [files] from the command line but it's not recognized.
According to Oracle Jar is part of the JDK. I have both 7 and 8 installed. How do I run the jar function?
I don't have a C:/Java that the Oracle documents show. I've tried running jar from within the JDK directories and with admin rights.
I'm not putting params in yet, want to check I can at least find the jar function first.
Running jar from JDK directory(1.8) http://puu.sh/eoer7/4fcd0ce63c.png
Running jar from System32 http://puu.sh/eoe3X/076d79b4e4.png
You have displayed two installations of the Java Runtime Environment (or JRE). You need to install a Java Developer Kit (or JDK), to get jar. Set your JAVA_HOME to the installation directory of the JDK, and add it to your PATH.
set "PATH=%PATH%;%JAVA_HOME%\bin"
Also, Using JAR Files: The Basics says (in part) JAR files are packaged with the ZIP file format, and you can use tools that can read and write ZIP files to work with them.
Why JWrapper JRE does not include javaws file, even when I using tag NoStripJREs=true.
How to run jnlp file using JWrapper JRE, like run another application via jnlp in runtime.
If the NoStripJRE tag is specified correctly you'll see this during the build output:
[Config] Will not strip JRE (leaving optional files)
However if you have already built the JRE then JWrapper won't build it again unless you delete the output JRE archives in your build folder. If you delete those then it will rebuild the JRE archives (this will take minutes) and it should leave the JRE as is.