I have a libGDX core and desktop projects in Eclipse. I have put JRuby complete JAR in the core project's build path. If you run the desktop project, it works.
But when you export the desktop project as a runnable jar, the scripting engine returns null because it can't find JRuby. But Jruby is in the build path of the core project!
I tried adding Jruby to the build path of the desktop project, but the same happens. What do I do?
When you export a Runnable JAR file. Don't forget to check:
Package required libraries into generated JAR.
Related
I have completed my JavaFX application within gradle build system, and it is working fine in all way. Now I want to export as a .EXE file for standalone software distribution, I tried much more tricks but no gain. If some one can help me out to wrap my project in a software setup, It would be grateful.
Follow these steps to export your JavaFX project into executable Jar
Goto> Project Structure
Goto>>Artifacts
Click "+">> To add new artifact
It will shows a dropdownlist
Select>>Jar>>From module with dependencies
You will see a nested window as shown
Select Main class of your project
Check In the Option " Copy to output directory.." >>Ok
Goto>> Menu-bar>>Build>>Build Artifacts
Select>> your Project.jar>> Build
This will create executable jar file in your project source folder
Locate your jar file in path project\out\artifacts..
Now you can run this jar file simple cmd commad or with batch file
Cmd Command>> Java -jar project.jar
Using batch file>> make .bat file name it "RUN" and write these commands inside
Specify the Java Runtime path and "Javafx Sdk path" along with VM
options & Project Jar
Run your standalone application .. Enjoy ;)
Creating an installer for the desktop platforms (Windows, macOS, Linux) has become easy these days. The tool of choice is jpackage which started to be shipped with JDK 14. It can either be used on the command line on the finished project or you can use a Gradle plugin (https://github.com/beryx/badass-jlink-plugin). If your project is not modularized you could follow this tutorial https://github.com/dlemmermann/JPackageScriptFX which also uses jpackage but together with Maven and some other tools from the JDK. The Maven part could easily be rewritten to Gradle, if needed.
I am creating a java application in netbeans that will require two executable jar files, one for the main application and the other for the application settings and config as states the application structure but i have a problem building the app in the netbeans ide, after each build the ide makes one jar file for the application and that for the settings is considered as a normal java class, please i don't understand this, how can i solve this problem.
i want the Main.java and the portefeuille.java to run as separate jar files in the same project but the ide builds only the Main.java as a jar file.
I have used Sikuli java .jar to test a website, now I need to make a runnable .jar file and give it to my costumer, but I do not know how to add Sikuli's dll files to the jar in a way that it does not change any thing on the costumer's computer. I am using Eclipse LUNA.
To add sikuli libraries with your java program's jar , you should add sikuli java.jar into build path path of your java project in the eclipse platform.
then export your project. It will add sikuli lib into your exported jar.
For my development project I am having to use Java jars and Shell script along with config files.
In eclipse currently I am just developing the Java jar applicaiton and then exporting it into a seperate folder where my Shell script is and other files.
Then I FTP this folder into server directory.
However I am running into problems where my shell script or java version are not the same.
Is there any way for me to just package it all into one eclipse project and export it as the following
My Project
shell script.sh
myappplication,jar
myconfig.cfg
archive folder
I tried putting it all in my SRC folder but all that I get out is a jar file from exporting the project.
Any suggestions welcome
I would recommend using either Ant or Maven, both of which are well-integrated into Eclipse (Maven is integrated by default in the latest release).
Depending on your project, it's possible Maven (which is a build lifecycle management system) is overkill, but check it out and see how it might aid your build process.
Using Ant would allow you to create a process which would gather your files together and transfer them to your remote system.
You can also check out ShellEd for building shell scripts in Eclipse. I've found it somewhat hit-or-miss, but it does allow me to stay in one IDE for most of my work.
I have created an app using JavaFX 2.1 and wish to export it to be tested. This is the first "real" application I've made, so I have never done this before. In Windows 7 with eclipse I export a runnable jar, click on it, and nothing happens. Can someone tell me why this might be?
Information on Packaging
The app below was packaged using the command line javafxpackager tool. JavaFX also provides ant tasks for packaging. I believe you could create an ant script for packaging and run it's tasks from inside Eclipse.
The e(fx)clipse plugin provides integrated JavaFX packaging functionality by wrapping the JavaFX ant tasks. When developing JavaFX applications with Eclipse, use of e(fx)clipse is highly recommended.
Verifying your JavaFX Packaging
Extract the jar files from the jar (jar xf <jarfile>).
Look at the extracted manifest (META-INF\MANIFEST.MF).
If the main class in the manifest is not com/javafx/main/Main then you have packaged the app wrong.
C:\dev\javafx\willow\dist>jar xf willow.jar
C:\dev\javafx\willow\dist>type MANIFEST.MF
Manifest-Version: 1.0
JavaFX-Version: 2.1
JavaFX-Application-Class: org.jewelsea.willow.Willow
JavaFX-Class-Path: lib\image4j.jar lib\PDFRenderer-0.9.1.jar
Created-By: JavaFX Packager
Main-Class: com/javafx/main/Main
C:\dev\javafx\willow\dist>java -jar willow.jar
For your manifest the JavaFX-Application-Class entry will vary and the JavaFX-Class-Path attribute is probably not needed.
The example jar I used can then be run from the command line using java -jar <jarfile>.
Like mentioned by the jewelsea e(fx)clipse provides you an export wizard which uses the ant tasks provided by JavaFX. You can find a step by step tutorial at https://wiki.eclipse.org/Efxclipse/Tutorials/Tutorial1