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
22
votes
3 answers

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…
darrickc
  • 1,872
  • 6
  • 27
  • 38
21
votes
7 answers

Why does my JAR file execute at CMD, but not on double-click?

So I've been writing a simple 3D GUI application that I intended for users to use simply by double-clicking on the JAR file. I got it working perfectly before putting it into the JAR file, and I got it working perfectly IN the JAR file while running…
AnonymousJohn
  • 1,587
  • 3
  • 12
  • 15
21
votes
7 answers

How to create Jar file from Maven project in eclipse

I have a Maven project, but I am not familiar to Maven. I wanted to create an executable JAR file from this Maven project to use it in another project by eclipse. How can I do this?
Questioner
  • 662
  • 1
  • 10
  • 26
21
votes
4 answers

Can I use the classpath to override a file in a jar that is being run?

I have a JAR file that contains an application as well as configuration files for that application. The application loads configuration files from the classpath (using ClassLoader.getResource()), and has its dependencies completely satisfied using…
Guss
  • 30,470
  • 17
  • 104
  • 128
20
votes
2 answers

How does a jar file get executed? Do the classes get extracted somewhere?

We know that jar is a compressed archive file format which acts as a container for compiled java classes and conf files. As far as I know, for reading any contents from a compressed container file, first they need to be extracted somewhere. So how…
Vivek
  • 11,938
  • 19
  • 92
  • 127
19
votes
5 answers

how to run or install a *.jar file in windows?

I have downloaded jbpm-installer-3.2.7.jar but I don't know how to install or run the file. If I double click on it, it opens in winrar. I tried installing through command prompt, but I got the following errors: C:\Documents and…
brainless
  • 5,698
  • 16
  • 59
  • 82
19
votes
1 answer

How to disable minidump (mdmp) files generation with Java Hotspot JVM on Windows

Currently I have a deployed executable jar file that creates large (7+ Gb) minidump files when it crashes. I would like to have a text representation of what caused the crash, not a binary file of the JVM state. I've tried using the information…
Lucas
  • 2,514
  • 4
  • 27
  • 37
19
votes
3 answers

How to make a executable file of JavaFX 2.0 project?

I want to make a executable file of my project which I made in JavaFX 2.0. Can anyone help me with this?
Bipin Bhandari
  • 652
  • 4
  • 9
  • 23
18
votes
2 answers

Scala SBT: standalone jar

The answer: Making stand-alone jar with Simple Build Tool seems like what I need, but it did not have enough information for me, so this is a followup. (1) How do I adapt the answer to my need? I don't understand what would need to be changed. (2)…
dsg
  • 12,924
  • 21
  • 67
  • 111
17
votes
2 answers

How to get java main class from jar file

I have an executable jar and i want to know the name of java main class from this jar My question are if there is a java cmd to get this from jar metadata ?
Yaz
  • 492
  • 1
  • 6
  • 20
16
votes
1 answer

Spring Boot MVC Multi-Module Executeable jar

I have a multimodule project, build with spring boot 1.1.7 The structure is + parent + import + web + backend My Parent Module will include kind of microservices, what I want to manage from my parent (dependencies what all use)…
Michael Hegner
  • 5,555
  • 9
  • 38
  • 64
15
votes
13 answers

How do I make my java application open a console/terminal window?

Is there any way I can make an executable .jar that will open up the command line when double clicked? I'm making a text-based adventure game. As of right now it is just a maze with rooms. Eventually it is going to be much bigger and more in depth…
CaldwellYSR
  • 3,056
  • 5
  • 33
  • 50
15
votes
1 answer

Running executable jar created by maven-assembly: Error: Could not find or load main class

Trying to create a fat jar including all the dependencies using maven-assembly plugin. Tried a bunch of things, but end up with main class not found error. Seems like I've hit a wall, been here for a few hours now. pom.xml snippet:
user2354302
  • 1,833
  • 5
  • 23
  • 35
15
votes
3 answers

What happens to "System.out.println()" in executable jar?

Suppose I've created an executable jar from a code where I have used System.out.println() When we run the executable jar, there is no console. So, what happens to this line? How does java handle this situation? EDIT 01: NOTE: The situation is when…
Minar Mahmud
  • 2,577
  • 6
  • 20
  • 32
15
votes
3 answers

Create an excutable jar in IntelliJ IDEA

I am using IntelliJ IDEA 12.1.3. I have one module and I am trying to convert it into a jar as per the steps given here. I built the jar file and I moved the jar file to D:/. If I try to run this jar I get the following message: Failed to load…
muthu
  • 5,381
  • 2
  • 33
  • 41