Is it possible that to run a JavaFX Application at windows boot time. what efforts i can make so that my java application automatically starts when windows(OS) start or boots ? (after displaying a windows logo, before desktop mode load)
I've had success packaging JavaFX applications into an .exe using the JavaFX Maven Plugin (https://github.com/javafx-maven-plugin/javafx-maven-plugin). You even have the option to bundle a JRE with it so it doesn't need to rely on the system's installed JRE. I imagine once you create the .exe, you can simply add it to your "Startup" folder. (https://support.microsoft.com/en-us/kb/2806079)
You may want to check out this link. The program "AlwaysUp" has unrestricted 30-day trial version. Try that and if you like it and don't want to pay for it, you can find the full version from torrent.
Related
I would like to know if it is possible to configure the Java VM used by Eclipse to run in this way, that it uses JavaFX SDK libraries.
Please be aware! I don't want to build JavaFX applications on my own in Eclipse, e.g. by using E(fx)clipse or other plugins.
Another remark: I don't use Java development perspective in Eclipse or a Java project. So it won't work to add the external .jars of JavaFX as user libraries!
In my use case I have an third-party GUI application based on JavaFX that has to be started out of Eclipse.
If I try to start this application I receive the following error:
The system reqirements are not met.
Could not find: javafx.properties
in:
/Applications/Eclipse.app/Contents/Eclipse/plugins/org.eclipse.justj.openjdk.hotspot.jre.full.macosx.x86_64_17.0.2.v20220201-1208/jre/lib
Your Java Virtual Machine seems not to support JavaFX,
required to run the XXX.
Please make sure you provide a valid path to the Java FX
modules during gui installation.
As you can see by the error message my Eclipse runs on a MacOS x64 system.
But I think the way to configure the VM of Eclipse should work on each system the same way.
Thank you.
Steve
If you have a third-party GUI application, then you do not need an IDE like Eclipse.
Ideally the publisher of your app would have provided the app as a package that includes the JavaFX/OpenJFX libraries as well as all the parts of a JDK/JVM needed to run that app on your Mac.
If the publisher gave you only the bare-bones app without the needed libraries & JDK/JVM, you can obtain a JDK/JVM bundled with those libraries.
At least two vendors supply a JDK with JavaFX/OpenJFX libraries:
ZuluFX by Azul Systems
LibericaFX by BellSoft
Both are available free-of-cost with optional support plans available for sale. Download either product as an installer specific to your Mac, while paying attention to either Intel-based Mac or Apple Silicon (ARM, AArch64) based Mac.
You can verify the install by using a console such as Terminal.app to run:
java --version
… and:
which java
You can also use the Finder to locate your installed JVMs by choosing Go > Go to Folder… where you paste:
/Library/Java/JavaVirtualMachines
If your app contains the necessary MANIFEST.MF file, you may be able to launch your app by double-clicking. If not, use a console such as Terminal.app with the java command to launch the app.
High level: I am working on a JavaFX app that I'd like to automatically update
Things I've looked at:
Add ability to automatically update co-bundled app (Open JDK official auto updater issue)
UpdateFX (Library for handling automatic updates)
Issue I am having: Trying to package two separate javafx native executables into one package.
Description:
I have created a JavaFX UI application that checks for an updated version upon startup. The application is delivered by building a native (using jfx packager) package for each OS: Liux, Windows and OSX.
If there's a newer version available the app downloads the required update into a temporary folder.
To update itself, the app technically needs to overwrite some of its own files. While this is possible to do on Linux and OSX, Windows locks all of the jar files that I need to update while the main application is running.
To get around this, I created a small "updater" application that I would download. My main application would download all of the updates AND the updater application. The main application would then launch the updater and kill itself.
The updater would continuously try to update that application files (this was in some kind of loop in case it took a while for the main application to shut down).
Once the updater would finish, it would simply call the correct main program's executable file and the update would be completed.
This works...BUT: In order to run my updater application, I am relying on the client's machine having java (and having the correct version to boot). The whole point of using the javafx native packager is to make sure that the JRE is distributed with the app and that there is no dependency on any local version.
I wanted to try a hack:
Instead of having my updater be a regular jar (java application). I could make the updater be a JavaFX application that I package natively.
I'd then manually take the generated native executable out of the updater and just distribute it with my main application.
Since the folder structures for both main executable as well as updater executable would be the same, I was hoping that both executables could piggy back on one bundled JRE
The hack only works on OSX - on both windows and linux there are local config files that the executable relies on to invoke the correct java file.
Is there any way to get around this issue? Is there any way to force the packager to output a custom "package.cfg" (in the case of windows) that would allow me to bundle two executables?
I realize this is a long shot, but any advice would be appreciated.
I may have asked my question just a bit before the code to do what I wanted was included in javapackager.
Short story is that this is now possible to do using javapackager that is part of JDK 1.8 release > 60 (I am now using 74)
Here's a link to the official oracle documentation: Oracle Doc
It's also possible to use Maven to build your JavaFX app to have secondary launchers via: javafx-maven-plugin
OK, I’m still a little overwhelmed by all the choices for deploying an application. My case is really simple. I have a Java program that’s now working in NetBeans on Win7. I want to run it on another Windows desktop that doesn’t have NetBeans.
The method presented here: https://netbeans.org/kb/docs/java/native_pkg.html produces a single .exe file that installs the application on the Win desktop. But, that file is huge because it includes all required portions of the JRE.
The method presented here https://netbeans.org/kb/articles/javase-deploy.html uses the JRE already installed on the Win desktop so the distribution is very small. But, it requires you to distribute both a .jar file and a lib folder.
So, finally, the question. Is there a method that uses the already installed JRE and only requires the distribution of one (small) file?
Thanks.
Since that second option has everything you need to run the app (provided that a JRE is available), you can use that with a third party install packager like izpack
I'm new to Java Swing & I'm a bit stumped. The application I'm developing will be installed on systems that have not installed JRE. Is there any way to pack JRE inside the Java Swing application and create an EXE file which installs JRE and the application?
Use deployJava.js to ensure a suitable minimum JRE is installed on the computer of the end user. Then use Java Web Start to install and launch the application itself.
Both of those are:
Supplied by Oracle for deployment of rich client apps.
Designed to work on Windows, OS X & *nix.
You can create .exe files from your Java program source using Launch4J. This tool offers an option to set up a relative path to a Java JDK/JRE. This means you could deliver your software with the needed JDK/JRE.
But be carefull. I think you get in trouble if you offer a JDK/JRE for download due to licensing issues.
Best way is to tell the users to install JDK/JRE themselves....
You have to use an installer for that. Try NSIS for instance
I make my executable jar in exe format, but I want to add JRE with this because if JRE is not present in their machine, they can use it with this included JRE.
But I do not want to install this JRE in their machine. This JRE is only used by this application only. It will just like game or other application. I use launch4j to make jar to exe but i did not find any option from where it can attach JRE and it has no option from where I can link my jar dynamically.
How do I achieve that?
If there is other free installer then mention it, and please give the procedure with example.
Since it has been established that your app. has a GUI, I will suggest Java Web Start as the answer.
But I do not want to install this JRE in their machine.
That is not a sensible requirement. The user might already have a usable JRE installed, if they don't they probably also don't want every Java based application to be installing its own 'private' JRE.
Oracle's deployJava.js can do the checking, and help guide the user through the steps of installing (which basically comes down to click 'OK' when prompted).
I make my executable jar in exe format,..
If you only intend to support Windows, what is the attraction of coding in Java? JWS supports any platform for which Java is available. That brings a lot more potential customers for the app.
I want to use free installer.
JWS is entirely free. Just like the JRE.
..please give the procedure with example.
Do you run an IDE? If not, do you otherwise have Ant installed? If that is a yes to either one, check out my small JNLP API examples. Each comes with complete source and a build file (an Ant build.xml).
Within a couple of keystrokes & a few moments, you can see the app. installed and launched on your desktop. For the end user, it is even simpler. Just click a link in a web page, and it all happens automatically (possibly with a security prompt - for the protection of the user).
I like JSmooth. You can give it a try here:
http://jsmooth.sourceforge.net/features.php
Flexible automatic Java VM detection
Detects the location of any Sun JVM installed. The wrappers use
several strategies to detect all the JVM available on a computer,
using windows registry, environment variables, windows path.
Detects
and uses Microsoft's JView (for 1.0 and 1.1 Java applications), if
available.
The JVM search sequence is fully customizable using the
GUI. You can force the executable to search in the path first, and in
the registry last, or in JAVA_HOME first. We have all the flavours!
Sometimes it's more convenient to bundle a JRE with your application.
JSmooth can deal with that too, you just need to define in which
folder the JRE is expected. It falls back nicely to a standard JVM
search if the JRE is not where it should be.
Specify which versions of
the JVM are compatible with your software. You can set a minimum
version, but also a maximum JVM version.
Documentation: http://jsmooth.sourceforge.net/docs/jsmooth-doc.html
Take a look at launch4j.
I had to use it, and it worked out very well.
You can set a minimum version of a needed JRE, bundle a JRE, or if a JRE is not found (and not bundled) the launcher may lead the user to a download location of an appropriate JRE.
There are various further features launch4j offers, and as opposed to another suggestion here, launch4j is activly developed
http://launch4j.sourceforge.net/