I have created a project to collect the daily status in an xls sheet, using the selenium webdriver.
Currently it runs well.
Can I make this project into a standalone application or a executable jar? Or is there some other way to collect the status by clicking on the application or jar to open it without having to compile and run from eclipse?
You can use install4j from below mention URL. It will make executable jar and application.exe also you can make installer for different platforms such as Mac, Windows and Linux.
https://www.ej-technologies.com/products/install4j/overview.html
hope it will help
From Eclipse select Export -> Runnable JAR File
Select 'Extract required libraries into generated JAR'
When you have your JAR file execute :
java -jar MyJar.jar
Related
Is there any way to create the exe file of spring boot application executable jar? I've used launch maven plugin but exe file which it's creation is not working. On double click it doesn't show application Console....
You can use Launch4J:
https://genuinecoder.com/convert-java-jar-to-exe/
Download Launch4J: http://launch4j.sourceforge.net/
Select your .jar and the output for your .exe
Select additional details, for example an Icon. Most basic configs speak for themself.
Include classpaths:
Aditonally select the required java version in the JRE tab.
Build the .exe!
--
Although in your case if you just want to run the .jar I would look at my other comment first and run it with
java -jar <jar-file-name>.jar
I'm working java swing application.My program run successfully in Eclipse but when i create running jar,it's does not opened.
I created running jar like this
In my option ,problem is that I'm using 4 jar library jmrtd.jar,Scuba.jar and etc.
What am I doing wrong? How i can create jar file,when I use some support libraries(jar files) ?
Please use option "Package required libraries into generated JAR"
I have scripted a selenium web driver program in java on eclipse IDE.
This program gets the data from a excel sheet placed on my systems desktop and all the jars are added in the build path from my desktop.
EXAMPLE:C:\Users\PEOPLE\Desktop\selenium-server-2.53.0\selenium-2.53.0\libs.
The entire program is exported into a runnable jar file and placed on the desktop.
The jar file is working fine as expected.
Now the question is how to make jar file run in other systems?
what are the pre requisites to make jar file run in other system?
I see two things mainly:
A Java JRE installed so that you can run java -jar yourJar.jar or java -classpath yourJar.jar your.package.name.MainClass
A way to configure the path for loading your Excel sheet (specially if the path is different on the other system). For instance, you could read this path in your Java program from a configuration text file app.config located in the same repository of your jar.
Hope it helps :)
Create the same path for the Excel file as is in your system (else you need to edit the Config file) along with the name of the file.Now, just install the latest JRE in the system and you should be good to go.
This question already has an answer here:
creating an executable jar file with ant which includes the build.xml file
(1 answer)
Closed 9 years ago.
i have created a java project in NetBeans. now i want to make an executable file out of it.that can be executed (run) in other computers that have JDK or JRE installed but don't have NetBeans or any other Java IDE installed.how can i do such thing using NetBeans???
Do you mean compile it to JAR? Netbeans does that automatically, just do clean and build (hammer sybol) and look in the dist subdirectory of your project. There will be the JAR with lib folder containing the required libraries. These JAR + lib are enough to run the application.
Maby you unchecked an option:
Project Properties -> Build -> Packaging -> Build JAR after compiling
(but this is enabled by default)
You have to build your project. Just click on the hammer in the toolbar.
After that there should be a folder in your project called "dist".
In it is the *.jar File, which you can deploy to anybody who has Java installed.
you mean executable jar file. which can be executed using $java -jar myJar.jar . So you need to change manifest file inside jar. Second if you want a mouse double click execution then for Linux create .sh and for windows create .bat file containing the above specified $java -jar .
JVM installation is required to do so on whichever machine you want to execute.
Click Me :-)
I have the following jar files for my app:
DesktopApplication1.jar
Plus , i have used the some extra API's for my app , like jsoup, jexcelapi etc. There are about 7 api's in the lib folder.
How to make a EXE file & RPM file out of all these jar files?
P.S. I am a first timer. So take that into consideration.also, I have used Netbeans 6.8. So the main API is in \dist folder. And the API used is in \dist\lib folder.
thanks in Advance
use jsmooth to make exe from jar
Build your JAR with fatJar to include all the dependencies in it, and then make it executable with your favorite tool (I use Launch4j)
RPM is little bit different, since it is not executable, but package format. There are lots of tutorials, how you build it up.
You could make a BAT file a file with .bat(For windows) extension
Just open notepad and write the following text
java -jar DesktopApplication1.jar
Save the file as filename.bat(the .bat extension is important)
Place the .jar and .bat files together and just double click the .bat file every time you need to run the jar...
If you don't want to keep both together then give the absolute path of the jar in the .bat file
java -jar AbsolutePath/DesktopApplication1.jar
For a linux machine make a file with (.sh) extension rest of the procedure is same...
Try InstallJammer. It provides what you want.
Deploy the app. with Java Web Start. JWS Can make it easy to add other Jars to the apps. run-time class-path, avoiding the common problem with fat jar of violating the API's distribution license (when it says WTE 'you are allowed to distribute this in unaltered form..') and can provide the further benefit of only downloading the parts that the user requires (when the user requires them).
JWS has many other cool features like desktop integration (menu bars, start menu item), splash screens, automatic updates, support by the owners of Java, and compatibility with any platform for which Java is available.
For creating .exe to run on Windows:
Download launch4j from http://launch4j.sourceforge.net.
build wrapper .exe through launch4j.
Download innoSetup from http://www.jrsoftware.org/isdl.php.
Build .exe as installer, the setup file, for user to download and install.
Install rpm for linux:
If your application used other native libraries, you need to download and install Linux native libraries. This is how we build rpm for our app.