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
14
votes
1 answer

Eclipse - Extract/package the required libraries into the same Runnable JAR

When exporting a project as a Runnable JAR file using Eclipse, there are three choices: 1. Extract required libraries into generated JAR 2. Package required libraries into generated JAR 3. Copy required libraries into a sub-folder next to the…
zw324
  • 26,764
  • 16
  • 85
  • 118
14
votes
2 answers

Creating Runnable Jar with external files included

I want to build a runnable jar in java. I need to include some of the files in the jar so that when I execute jar the files are automatically read from the java class. Hence I created a folder in the project and referred these files from the…
Anup
  • 265
  • 2
  • 6
  • 14
14
votes
2 answers

Packaging a Jython program in an executable jar

I am trying to package a jython program into an executable jar which the user can simply double-click to run without installing jython ahead of time. Ultimately, I would like to include an additional library which I wrote with the jar, but at the…
Kyle
  • 280
  • 8
  • 19
13
votes
3 answers

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?
Penchant
  • 1,165
  • 7
  • 19
  • 28
13
votes
2 answers

SpringBoot fully executable jar without dependencies inside

NOTE: Please, before marking this question as a duplicate make sure you know the difference between executable JAR and fully executable SpringBoot JAR. The official Spring Boot documentation describes how to build fully executable JAR. Then…
humkins
  • 9,635
  • 11
  • 57
  • 75
13
votes
1 answer

"scala.runtime in compiler mirror not found" but working when started with -Xbootclasspath/p:scala-library.jar

I'm trying to run a Scala application packed as JAR (including dependencies) but this fails until the Scala library is added by using the -Xbootclasspath/p option. Failing invocation: java -jar…
Augustus Kling
  • 3,303
  • 1
  • 22
  • 25
13
votes
3 answers

Convert Java to .app file for MacOSX using JarBundler

All I'm trying to do is convert a simple java program into a macOSX .app file so I can distribute it as a simple executable file. I've read all over the place and everyone says the same things: Use Xcode - As far as I can tell, Xcode no longer…
Jason Robertson
  • 164
  • 1
  • 1
  • 9
13
votes
4 answers

Windows service installed with Procrun works in //TS mode, but doesn't start as a Windows service saying it "started and then stopped"

I installed a standard executable jar file as a Windows service by running the following command: > prunsrv.exe //IS//"My Service" --Install="C:\path-to-prunsrv.exe" --Jvm=auto \ --Startup=auto --StartMode=jvm…
11101101b
  • 7,679
  • 2
  • 42
  • 52
12
votes
3 answers

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…
Jordi
  • 5,846
  • 10
  • 40
  • 41
12
votes
5 answers

Export Scala application to runnable JAR

Can you tell me, if this is possible, how to export a Scala application to a normal runnable JAR that can run directly in the JVM ? Thanks
Radu Stoenescu
  • 3,187
  • 9
  • 28
  • 45
12
votes
2 answers

Exporting A Libgdx Game as Executable Jar from Android Studio

Okay so I made a game using Libgdx and I intended it to be a android app(which is why i use android studio) but I want to let my friend without android phones try it out. The project is already setup for both desktop and android so is there any way…
user1804234
  • 331
  • 1
  • 3
  • 13
12
votes
4 answers

Runnable Jar cannot find Resources and Other Libraries

I created a desktop app and I have run into a problem with my generated runnable jar. Everything works fine in the Eclipse environment, but when I generate the jar it only shows theswtcomponents (menu, tabs, etc..). The other libraries location is a…
piczaj
  • 424
  • 1
  • 8
  • 21
11
votes
10 answers

UnsupportedClassVersionError: has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version (..)up to 52.0

I'm trying to launch the jar file I've builded for my Spring Boot project. First I did: mvn clean package spring-boot:repackage then I've tried to launch the jar file, and I had the following error: Exception in thread "main"…
Usr
  • 2,628
  • 10
  • 51
  • 91
11
votes
1 answer

JPMS/Jigsaw Missing Main Class in Module

I'm trying to create a modular, executable jar file, that can be run with java -p -m on Java 9.0.1. This works as expected when creating a jar with jar cfe test.jar test.Main -C classes/ ., but throws module test does not have a…
kantianethics
  • 671
  • 5
  • 21
11
votes
5 answers

JAR hidden inside EXE?

Minecraft, a Java game, is free this weekend. The Windows version downloads as an exe file. I was curious what the EXE file is doing and where it's unpacking and running the actual game JAR from. So using a command, I found the command-line…
Ricket
  • 33,368
  • 30
  • 112
  • 143