executable-jar

Using Maven 1.x without extra plugins, how does someone build an executable jar?

Using Maven 1.x with just the bundled/standard plugins, what configuration is necessary to build an executable Jar? Answers should cover: including dependencies in target Jar proper classpath configuration to make dependency Jars accessible ...

How to specify JVM argument for Maven built executable JAR

When using Maven to build an executable JAR, how do I specify the JVM arguments that are used when the JAR is executed? I can specify the main class using <mainClass>. I suspect there's a similar attribute for JVM arguments. Specially I need to specify the maximum memory (example -Xmx500m). Here's my assembly plugin: <plugin> <a...

NoClassDefFoundError while trying to run my jar with java.exe -jar...what's wrong?

I have an application that I'm trying to wrap into a jar for easier deployment. The application compiles and runs fine (in a Windows cmd window) when run as a set of classes reachable from the CLASSPATH. But when I jar up my classes and try to run it with java 1.6 in the same cmd window, I start getting exceptions: C:\dev\myapp\src\co...

How to get the path of a running jar file?

My code runs inside a jar file, say foo.jar, and I need to know, in the code, in which folder the running foo.jar is. So, if foo.jar is in C:\FOO\, I want to get that path no matter what my current working directory is. ...

How to use a file in a jar as javax.net.ssl.keystore?

I'm trying to do something like URL clientks = com.messaging.SubscriptionManager.class.getResource( "client.ks" ); String path = clientks.toURI().getPath(); System.setProperty( "javax.net.ssl.keyStore", path); Where client.ks is a file stored in com/messaging in the jar file that I'm running. The thing that reads the javax.net.ssl.k...

Executing a Jar on Vista with a double click

This pretty much has me defeated. On XP and earlier versions of Windows you could customise Open With filetypes to include java - jar "myjar.jar", but on Vista this functionality seems to have been removed. I can of course create a .bat file to launch my application, but is it possible to make Vista execute a .jar as required? ...

maven-camel build problem

I have a simple application using netbeans for developing and maven for building et all. My application uses camel , spring XML configured. I wanted to build an executable jar with dependencies so i am using the maven-assembly plugin with 'jar-with-deps' descriptor. The jar is built ok but I think that since all the dependencies get unw...

Running Jar file in Windows

I have a "helloworld.jar" file. For running a JAR file I am using a command-line window and executing the following command: java -jar helloworld.jar By using this command I can execute the JAR file. But instead of doing it in a command-line window, I want to execute the JAR file if I double click on the JAR file. I did some Googl...

how do I convert my java files into an application?

I coded up 4 .java files. The thing is that I can only execute my .java files from my IDE, how do I execute the .class files like an application? I study at uni, and I was told that Java is platform independent. Any tutorial/book recommendations would be highly appreciated. Thanks ...

Getting input and output from a jar file run from java class?

Hi, I have a jar file that runs this code: public class InputOutput { /** * @param args * @throws IOException */ public static void main(String[] args) throws IOException { boolean cont = true; BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); while (cont) { System.o...

Executable Jars running very slowly

I've done several projects and packaged them into jar files, but I've noticed that my jar files run much more slowly than in my IDE. I use Eclipse to compile and run my programs. In Eclipse, I have everything working. When I package my project as a runnable Jar and execute it by double-clicking, everything still works. But when I have a...

How can you package an executable jar with a portable JRE?

I want to be able to distribute by executable JAR without having to make the user upgrade to the latest version of the JRE. How can I package a JRE into the JAR so that they can run the jar with no JRE installed on their system? ...

Give an Executable Jar a Custom Image

Hi all, Just finished a little app that I want to distribute and at the moment for windows platform it is just an executable jar. Is there anyway to give this jar another image than the java cup? Thanks ...

How to get executable file of Java programm...

Im trying to export a program written in java (JDK 1.6.0) to a .jar file. To my project, I have added one Java library(which was available on internet) and some Java source files. So when i create the jar file, the classpath should be set by default and the person should be able to run the project directly either from command prompt or...

Executing a JAR on X startup

I'm trying to setup a kiosk type system in linux where a java application launches when X is initialized. I've got a script which does the following: java -cp {correct path to JAR with main method} -jar {name of JAR} When I've cd'd into the directory where the JAR sits, everything is peaches and the system works like I want, however, ...

JAVA jar execution problem

When i execute the application in jidea ide it executes fine. But when i double click the jar file it shows the gui fine, then i click a button which must create some objects, but only some objects created, in that action call some constructors does not called. But when this is done in the ide all the constructors called!!! what is the ...

How do I configure an OSGi environment so that it is possible to use it from the EclipseStarter class?

Hi there! Currently I'm trying to execute some bundles using the capabilities of the EclipseStarter class. If I run my program directly from Eclipse the OSGi service bundle is loaded and I'm able to install and start other bundles. But if I export my java program to a executable jar-file and run it from the command line the environment...

System.out not working when calling jar-file from Windows command line

I have this class: public class Test { public static void main(String[] args) { System.out.println("Hello World!"); } } And I used Eclipse's "Export to runnable JAR" function to make it into a executable jar-file (test.jar). When I run this program in Eclipse, it prints out "Hello World!", but when I call the jar-file from the com...

adding jars to your program

i have a simple Demo.java file in D:\jarConcepts directory: import javax.swing.* ; class Demo{ public static void main(String args[]){ JFrame frame = new JFrame("") ; frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE) ; Class c = null ; try{ c = Class.forName("com.mysql.jdbc.Driver") ; //com.m...

"Invalid signature file" when attempting to run a .jar

My java program is packaged in a jar file and makes use of an external jar library, bouncy castle. My code compiles fine, but running the jar leads to the following error: Exception in thread "main" java.lang.SecurityException: Invalid signature file digest for Manifest main attributes I've googled for over an hour searching for an exp...