FAQ Database Discussion Community


Export an executable Jar from Eclipse

java,eclipse,executable-jar
What are the differences between those three options for Library handling while exporting an executable jar from Eclipse ? which one is better and the generated jar executes faster? I currently tried the first and second option, it seems like the firs one runs faster, but I don't know why....

Start and Stop java process from JAR Fil

java,jar,executable-jar,runtime.exec
I am working on a multi-platform GUI for a project. The GUI needs to have the functionality to start and stop the other .jar file using buttons. The GUI is coded in Java and compiled as an executable Jar file. For example. When the JButton start is pressed the file...

Java - Get file as an input from Project folder

java,file,input,command-line,executable-jar
I have created a simple automated script for parsing my input files. My input file is a command line argument. My program works fine if I keep this input file in src folder. But, I when I run my program by making it as an executable jar file I am...

Disable Java security and warning messages

java,security,executable-jar
I update Java 6 to Java 8u25 and now appear two messages: First message: Do you want to run this application? Name: ----.jar Second message: Warning - Unavailable Version of Java Requested:This application would like to use a version of Java (1.6) that is not intalled on your system. These...

Jar error: could not find or failed to load main class

java,executable-jar
I have built a simple GUI that takes in unorganized HTML code and organizes it...now that I have it working finally I need to learn how to distribute it. I managed to create my .jar file but when I try to run it I get "Error: could not find or...

Why I obtain this “Unable to access jarfile” error when I try to execute my jar?

java,jar,jvm,executable-jar
I have the following problem trying to execute a jar file (created from my project) into the Windows shell (the DOS prompt). I have a file named Main.jar. If I unzip this file it contains a mainPkg folder (that is the name of the package containing the Main class that...

spring.xml not packaged in executable jar

java,spring,maven,executable-jar
I created a simple java application using maven, spring and used log4j for logging. Following are the files. public class TestCrawler { public static final String SPRING_CONFIGURATION_FILE = "spring.xml"; private static final String INITIAL_URL = "http://yahoo.com/"; private static final String SPIDER_BEAN = "spider"; public static void main(String[] args) { System.out.println();...

ServerSocketChannel ignores System.setProperty(“java.net.preferIPv4Stack”) when run from Eclipse-generated jar

java,executable-jar,ipv4
When using com.sun.net.httpserver.HttpServer, I observed the following in an application: When run not from a jar (e.g. from Eclipse or on command line) System.setProperty("java.net.preferIPv4Stack", "true"), HttpServer.getAddress() returns an IPv4 address as expected. When run from an executable jar generated by hand (i.e. jar cvfe ... rather than Eclipse export), it...

Is it possible to jar a spring application?

spring,maven-plugin,executable-jar
I have a web application in spring and hibernate and maven. I want to package my services and create a jar so that when main method is invoked, it will take the spring configurations from class path and it will call the services. Is it possible?

Recursively read images from an executable JAR file

java,arraylist,jar,java-8,executable-jar
I am trying to display a number of BufferedImage elements stored in an ArrayList<BufferedImage> by first reading them from the disk to the arraylist then iterating across the arraylist. Since the images are organised into subfolders on the filesystem, I read them into the arraylist with private void storeImages(final File...

Unable to scan components from sub-package - Spring Jar

eclipse,spring,executable-jar
I'm developing a spring command line app which uses dependency of external jars. When I run the app from eclipse it works perfectly, but when I export it as runnable jar it fails to autowire the dependecies from the sub-package. However if I write each bean definition in spring-context, then...

Creating Textfiles within executable JAR

java,csv,executable-jar
I have created a java application which runs fine, and I have exported it as a jar. The jar export also runs properly, except for one issue: when I run it e.g. on the desktop, it creates csv files on the desktop. Is there a way to create csv files...

About citing external files in java application

java,executable-jar
I am writing a java application, in which I am automatically importing external csv files in background to do the computation. But the problem is that I am using "absolute" file path in my java program, the generated jar file will not work in another computer. Is there anyway in...

Export as an executable jar file

java,eclipse,bash,maven,executable-jar
I have an maven eclipse project which I want to export as an executable jar file from command line. I have external library jars also in the project. How can I get the executable jar file inclusive of all library jars from command line? EDIT:: Now there is a challenge.There...

get parameters of JAR installer

executable-jar,silent-installer
I have a jar file that allows me to install some software, this JAR request me to fill many fields everytime. I need to write a script or something to fill this data automatically. I know how to pass parameters to the JAR file but I dont know the parameters...

apache spark: akka version error by build jar with all dependencies

java,maven,jar,apache-spark,executable-jar
i have build a jar file from my spark app with maven (mvn clean compile assembly:single) and the following pom file: <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>mgm.tp.bigdata</groupId> <artifactId>ma-spark</artifactId> <version>0.0.1-SNAPSHOT</version>...