Intellij Maven Javafx Project jar packaging problem for MacOS - java

I have completed a project using Intellij with Maven dependencies, running on openjdk-18.0.2.1 with external CalendarFx excutable jar. I wanted to make it into a clickable application for my M1 Mac but I have been stuck on deployment for 30 hours. I have searched videos such as jlink to package app, artifact javafx build with jar modules config, [putting dlib of openjdk directly into artifact] (https://www.youtube.com/watch?v=F8ahBtXkQzU&t=149s&ab_channel=Randomcode) and stackOverflow but none of them seem to have worked. Can I get some help with deployement?
It would be great if you could provide me with a solution that you have used my application to successfully convert into app and running. I'm afraid that otherwise might not be clear or is prone to errors during my tries like the many other videos and stackoverflow I checked. Thank you very much!
The project is located in https://github.com/Shonn-Li/Clinic, to set up you need set SDK as openjdk 17+, you may also need CalendarFx downloaded from [calendarFXview] (https://search.maven.org/search?q=g:com.calendarfx%20AND%20a:view) as a jar and put it in dependencies.

Related

Deploying a NetBeans application with JavaFX

I am attempting to build an application in NetBeans that can be deployed to and end user. I am still pretty new to deploying projects and this is by far the most complicated one I have done so please bear with me. I currently have a working application in NetBeans which utilizes JDK 15 and JavaFX 15. As long as I run things inside of NetBeans everything works as intended. I have reached a point where I want to make sure I can distribute this application outside of NetBeans. To this end I did some searching and found the following tutorial.
https://netbeans.org/kb/articles/javase-deploy.html
I was able to follow the tutorial and build the example. The build works in NetBeans, I am able to run the executable jar file in the dist folder from the command line, and I am able to run the jar file by executing it from the file explorer. Now when I attempt to do the same process with my own project I run into the following errors.
When I attempt to run the jar file in the dist folder absolutely nothing happens.
When I attempt to run the jar file from the command line using the command
java -jar "C:\Workspace\HandyAndyVersion1_2\dist\HandyAndyVersion1_2.jar"
I receive the following error,
Error: JavaFX runtime components are missing, and are required to run this application.
I am currently under the assumption that the first problem is a by product of the second. If anybody has a solution to this problem or any ideas on what I could have configured wrong please let me know and thank you all in advance.
To package a Java desktop application these days, you should be using the jpackage tool and optionally the jlink tool. These will generate a JRE image that is packaged with the application and contains the modules you need.
I suspect the issue you are running into is that the native libraries for JavaFX are not present. Most distributions of JDK 15 do not contain the JavaFX modules, though some do. (See the Full and FX bundles of the JDK from Azul and Bellsoft). I find it is easier to use a JDK with JavaFX bundled rather than have to manage a separate module path during development for the jmod files of JavaFX, but that is another option. Either method can be used with jlink to create a suitable JRE for your application that includes the JavaFX modules.

AppleScriptEngine in java jar is not working, what am I missing?

I am trying to incorporate Apple's script engine in my java app developed for macOs. I use eclipse to develop and when I run a debug build from eclipse all the Apple Script functions work.
As soon as I export it to an external jar and run that on the same machine they do no longer work.
I've searched and found some issues which I all tried, here is a summary:
using getEngineByName("AppleScriptEngine") now.
Adding the META-INF file javax.script.ScriptEngineFactory with the contents: apple.applescript.AppleScriptEngineFactory
cleaning and rebuilding several times
I opened the jar to see if the META-INF file is present and it is.
searched in /System/Library/Java/Extensions/ for a applescript jar file but it was not there.
I also searched for the /Library/Java/JavaVirtualMachines to see if it is there but also not the case
It is still not working. So I do not know what the difference is exactly between eclipse debug run and running a jar in macOs but there has to be something I am missing.
As far as I can figure out it seems that the apple scripting class is not installed but then how does eclipse use it?
As I understand there is a difference between java JRE versions so I am in need of a solution for all of them because I do not know what systems are running my app.
Any help is appreciated!

How can I run a gradle based Libgdx eclipse project in AIDE on Android?

Before Gradle was used with libgdx I could just open my Eclipse project in AIDE and everything worked fine. As of libgdx version 1.0 I now use Gradle in Eclipse but I don't know how to get this to work with AIDE.
It's not finding the jar libraries because I get compile errors about unknown libgdx classes.
Do I have to add a local Maven repository or is there another way?
Thanx!
I had similar issues, and what worked for me is I started a libgdx project within AIDE (yes it has that function), let it set itself up properly with all the libraries etc in the lib folder, then copied my code into the respective core, android etc folders as appropriate.
It's a bit fiddly, and I'm still not 100% there yet as I'm trying to work off two git branches, one for laptop (with gradle, your original project), and one for AIDE (with all the libraries already in it)
It should at least help you get your project working.

Can't deploy vaadin project

i have a little vaadin project for a school project that originally deployed well and worked.
i am using jboss as 7.1.1, vaadin7 and jdk8. My target platform is a raspberry pi running raspbian os.
so i am using the pi4j library to access the gpio interface of the raspberry and everything worked just fine until i implemented a check for null when creating a new instance of the web page. at first the error was because somehow the "jboss/standalone/deployments/roboterarm.war/WEB-INF/..../classes" directory became empty. afterwards the error came to eclipse as i could not use the pi4j library anymore. i did not touch the libraries and i can't figure out why it suddenly stopped working. i reinstalled eclipse, jboss and redownloaded all the libraries but i still can not use anything, not even in normal java applications!
afterwards i grabbed a copy from SVN that used to work normally but no luck there either, i can not use the pi4j jar-files.
everything looks fine to me there, yet it fails to give me code completion or compilation
i also tried creating a new vaadin project and c&p'ing the source code into the new project but the jar files are not recognized there either.
What am i doing wrong? how can i fix this? thanks in advance!
Eclipse buildpath, clearly indicates that your JRE is not properly added. Add your JRE to your build path, using the option Add Library.

I have just installed android SDK updates and now my projects are full of errors

I recently just installed downloaded and installed some updates in the android sdk to get access to some features and now when I have restarted eclipse all the projects have errors!!
Theres a small error at the start of package and the only resolutions it suggests is reconfigure build path, here is a picture of the carnage. Does anyone know how I can resolve this?
If java.util is an offending import, you haven't got your JRE configured properly or either the build or the IDE are in a kind of corrupted state. Since you already used the Clean command I'm going for a more complex issue.
Check your project's configuration and make sure you're not still referencing your old Java implementation. If by installing updates you mean that you downloaded a new version, installed it and then deleted the one you've been using so far, then the IDE might not be finding the JRE system library your project has currently configured.
Try right clicking your project > Build Path > Configure build path, then check if your current JRE system library is unbound. If so, you'll have to configure it again on the Libraries tab by using Add Library > JRE System Library.

Categories

Resources