Questions tagged [executable-jar]

A special type of jar file which contains all non-standard libraries and definitions necessary to run an application on a JVM.

An executable java program which can be started manually by typing java -jar foo.jar. Some operating systems (including Windows, Solaris and some Linux distributions) provide means to run the jar just as any other executable on that system.

Executable JAR files are distinguished by a 'extra field' on the first file with a hexadecimal field code of 0xCAFE. They must also specify a main class in the manifest (Main-Class: fooPackage.BarClass) which will be used to start the application.

2420 questions
6
votes
2 answers

Create debian package from executable jar source without using any tools and scripts

I have created a package based on http://packaging.ubuntu.com/html/packaging-new-software.html sample. In this sample, sources are c++ files. I want to create my new package from executable jar files source. I found maven, ANT and dhBuild tools but…
Shaho Amini
  • 390
  • 4
  • 11
6
votes
2 answers

How to make ImageIO read from InputStream :Java

I have created executable jar file(using Eclipse) , there are a set of image (.png) files that is to be inculded in the jar. So I have added a source folder with all the images inside /images folder in the project . Code has to access these file to…
2FaceMan
  • 443
  • 2
  • 18
  • 34
6
votes
1 answer

AJAX with Struts 1.x Version

I am having an application developed with Struts1.3, Jboss4.X version and jdk1.5 Now as an enhancement we are planning to implement AJAX to the web application Can you please suggest me Whether I can use AJAX with Struts1.3 Framework? Which Jar I…
gmhk
  • 15,598
  • 27
  • 89
  • 112
6
votes
1 answer

Java + Maven + make executable jar + Exception in thread "main" java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory

I have a problem with executing a jar. When I do: mvn package I get my jar in the target folder but I get a NoClassDefFoundError on the LoggerFactory of slf4j api when I want to run it. This is my POM.xml:
t0tec
  • 330
  • 4
  • 16
6
votes
2 answers

On Intellij 13, executable jar created is invalid or corrupted

I tried to create an executable jar from my project on Intellij 13 (win8), following these answers How to build jars from IntelliJ properly? and execute the jar created, then I get "Error: Invaid or corrupt jarfile" followed by the path of the…
Arthur Julião
  • 849
  • 1
  • 14
  • 29
6
votes
3 answers

Java - Writing to txt in a JAR file

Possible Duplicate: How can a Java program use files inside the .jar for read and write? How do I write to a .txt file from a JAR java compiled project? When I run my projects, it doesn't give errors, but it just doesn't write to the .txt inside…
Koen Demonie
  • 539
  • 1
  • 7
  • 24
6
votes
1 answer

How to use JavaFX WebView in DesktopApp with local files?

My webview works like charm when I use it within eclipse but as soon as I pack the application into a jar file it throws the following error: This page contains the following errors: error on line 33 at column 26: StartTag: invalid element…
user1641778
  • 61
  • 1
  • 1
  • 2
6
votes
1 answer

The magic behind the eclipse generated executable jar file

I can make a executable jar file with Eclipse. Let's say it is called ast.jar, and the Main class is ASTExplorer. I can verify that this works with java -jar ast.jar. Then, I unzip the jar file in a separate directory and verify that the…
prosseek
  • 182,215
  • 215
  • 566
  • 871
6
votes
3 answers

Double Clicking JAR file does not open Command Prompt

I want to run a Jar file by double clicking it. Following is the only Java class file present in it. import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.IOException; public class Sysout{ public static void main(String[]…
whitehat
  • 2,381
  • 8
  • 34
  • 47
6
votes
5 answers

Java executable Jar File

I am trying to make an executable jar file from eclipse (using MySQL as database). How can can I make the executable jar file? I made one but it shows some warning and not works. I am getting a long warning list. Here is the warning: JAR export…
sohel14_cse_ju
  • 2,481
  • 9
  • 34
  • 55
6
votes
5 answers

Starting Java app from cmd works, from batch not

The Problem is as follows: I have a Java Application packed in a ".jar"-File. I can start the App (Swing Application) by either doubleclick on the jarfile commandline java -jar MyApp.jar However when I put the commandline command into a batchfile,…
Fildor
  • 14,510
  • 4
  • 35
  • 67
6
votes
6 answers

JAR file: Could not find main class

Okay, I have a strange problem. I wanted to run one of my programs as a .jar file, but when I open it by double-clicking it, I get an error message like "Could not find main class, program is shutting down". I'm pretty sure I did everything right,…
FR24601
  • 63
  • 1
  • 1
  • 4
5
votes
3 answers

Generating a Jar in Eclipse including external library

I have a java application I've written in eclipse. It works fine there. It works fine run from a command line in the directory where I export it to. In that directory is another directory containing two jar files that I need for the application,…
arcy
  • 12,845
  • 12
  • 58
  • 103
5
votes
1 answer

Access a file from a JAR in the same folder

I need to acces (create and read) a file from a JAR file (executable jar), and that file should be created in the same directory as the JAR I tried this.getClass().getResource("myFile") but since the jar has packages in it, it won't work.. I…
Pronte
  • 256
  • 1
  • 3
  • 8
5
votes
2 answers

Adding custom string in java manifest 'Classpath' via maven pom.xml

I am creating a manifest file for my java jar via following pom.xml directives: org.apache.maven.plugins maven-jar-plugin
Ashish Sharma
  • 1,124
  • 2
  • 24
  • 49