Skip to content

Convert JAR to DEB

Package a Java JAR for Debian systems with jpackage, dpkg-deb, or FPM.

Convert JAR files online

We don’t have a dedicated online converter for JAR to DEB yet, but you can convert JAR files online to these formats:

Want to convert JAR to DEB?

Let us know. We pick the conversions to add next by how many people ask for them.

How to convert jar to deb file

A Debian or Ubuntu system needs a DEB when a Java application must be installed through apt, a graphical software center, or an internal package repository. The operation is normally repackaging: the JAR remains inside the DEB while Debian metadata, installation paths, and an optional launcher are added.

What the JAR format is

A JAR file is a ZIP-based Java archive containing compiled .class files, resources, dependency information, and often META-INF/MANIFEST.MF. An executable JAR usually declares a Main-Class manifest entry and can be started with java -jar application.jar.

Java developers, build systems such as Maven and Gradle, IDEs, and application distributors use JAR files for standalone programs, libraries, plugins, command-line tools, and build artifacts. A JAR can require a particular Java release, external dependency JARs, environment variables, a working directory, configuration files, or native libraries.

What the DEB format is

A DEB file is a Debian binary package used by Debian, Ubuntu, Linux Mint, and related distributions. Internally, it is an ar archive containing debian-binary, a compressed control archive with package metadata, and a compressed data archive containing the files to install.

Unlike a JAR, a DEB records a package name, version, architecture, description, dependencies, and installed file paths. Package managers can install, remove, upgrade, and track those files. A Java application package can declare its required Java runtime and install a command, desktop entry, or system service that starts the application.

Choose the packaging method

jpackage is usually the best option for a distributable Java application. It is included with modern JDKs and can create a DEB with application metadata, a launcher, and, when configured, a bundled Java runtime. It runs on Linux and is intended for packaging rather than merely renaming or recompressing the JAR.

dpkg-deb is the native low-level tool when the JAR should use the system Java runtime and the package layout must be controlled manually. FPM is a convenient alternative for repeatable internal packages. Archive managers such as Ark or 7-Zip can inspect these files but cannot create correct Debian package metadata.

There is no generally reliable online JAR-to-DEB converter. A service cannot safely infer Java-version requirements, Debian dependencies, launch commands, filesystem ownership, services, or desktop integration. Uploading a proprietary JAR may also expose application code, embedded credentials, or private assets; build the package locally instead.

Create a DEB with jpackage

  1. Install a JDK that provides jpackage, and verify it with jpackage --version. Build the application first so that the main JAR and every required dependency JAR are available in one directory such as dist/.
  2. Run a command similar to this on a Debian-based Linux system:
    jpackage --type deb \
      --name MyApp \
      --input dist \
      --main-jar application.jar \
      --main-class com.example.Main \
      --app-version 1.0.0 \
      --linux-package-name myapp \
      --linux-deb-maintainer 'Maintainer <maintainer@example.com>'

    Omit --main-class if the main JAR manifest already supplies Main-Class. Add options such as --icon, --linux-shortcut, and --description when the application needs desktop integration. The generated package is normally architecture-specific because the launcher and bundled runtime can contain native files.

  3. Inspect and test the generated file with dpkg-deb --info myapp_1.0.0_amd64.deb, dpkg-deb --contents myapp_1.0.0_amd64.deb, and sudo apt install ./myapp_1.0.0_amd64.deb. The exact filename and architecture depend on the JDK and build host.

jpackage may require Debian packaging utilities such as dpkg-deb and fakeroot. A bundled runtime increases the package size but avoids requiring the target system to provide a compatible Java installation.

Create a package manually with dpkg-deb

  1. Install the native packaging tools: sudo apt install dpkg-dev.
  2. Create a staging tree and copy the JAR into an application-private directory:
    mkdir -p myapp/DEBIAN myapp/usr/share/myapp myapp/usr/bin
    cp application.jar myapp/usr/share/myapp/application.jar
  3. Create myapp/DEBIAN/control with valid metadata. Continuation lines in the long description must begin with one space:
    Package: myapp
    Version: 1.0.0
    Section: utils
    Priority: optional
    Architecture: all
    Depends: default-jre-headless
    Maintainer: Package Maintainer <maintainer@example.com>
    Description: Java application
     Packaged Java application launched from a Debian command
  4. Create the launcher at myapp/usr/bin/myapp:
    #!/bin/sh
    exec java -jar /usr/share/myapp/application.jar "$@"

    Make it executable with chmod 755 myapp/usr/bin/myapp.

  5. Build, inspect, and install the package:
    dpkg-deb --build myapp myapp_1.0.0_all.deb
    dpkg-deb --info myapp_1.0.0_all.deb
    dpkg-deb --contents myapp_1.0.0_all.deb
    sudo apt install ./myapp_1.0.0_all.deb

Use Architecture: all only when the package contains no CPU-specific native library, launcher, or bundled runtime. Use a matching value such as amd64 or arm64 otherwise. Replace default-jre-headless with a specific dependency such as openjdk-17-jre-headless when the application requires that Java release. For several dependency JARs, copy them into the package and adjust the launcher classpath or use the application’s existing startup script.

Use FPM for a shorter build

After staging the application under myapp/usr and creating the launcher, FPM can create a DEB from that directory:

fpm -s dir -t deb -n myapp -v 1.0.0 \
  --architecture all \
  --depends default-jre-headless \
  --description 'Packaged Java application' \
  -C myapp usr

Install FPM and its Ruby prerequisites according to the distribution’s current packaging instructions. FPM does not discover correct Java dependencies or application behavior automatically, so inspect the result with dpkg-deb and test installation and removal on every supported distribution.

Compatibility limits

Repackaging does not convert Java bytecode into native Linux code. The target still needs a compatible runtime unless jpackage bundles one, and a JAR compiled for a newer Java release will not run on an older runtime. A DEB also does not automatically solve missing external libraries, native dependencies, writable configuration locations, service permissions, or required environment variables.

Applications needing desktop integration may require a .desktop file and icons; background applications may require a systemd unit and carefully designed maintainer scripts. Test fresh installation, upgrade, removal, command-line arguments, file ownership, and operation under a normal user account. Sign packages or publish them through a signed Debian repository when distributing beyond local testing.

JAR vs DEB: format comparison

How the JAR and DEB formats compare on the properties that matter most for this conversion.

Comparison of the JAR and DEB file formats
Property .JAR Java Archive .DEB Debian binary package
Compression Both Both
Compression ratio Medium Medium
Encryption Yes No
Split archives No No
Recovery record No No
Operating system support Wide Wide
Typical file size Medium Small
Open standard Yes Yes
Introduced 1996 1995
Developer Oracle (originally Sun Microsystems) Debian Project
MIME type application/java-archive application/vnd.debian.binary-package

Information about file extensions and file types is provided by File-Extensions.org

Frequently asked questions

Does converting a JAR to DEB change the Java app?

Usually, the JAR itself can remain unchanged inside the Debian package. The package adds installation metadata and may also include a launcher or Java runtime, depending on how it is built.

Will a DEB made from a JAR run on any Debian system?

Not necessarily. It needs to match the system architecture and have the required Java runtime and any other dependencies available or included.

Can I convert a DEB back to the original JAR?

You may be able to extract the JAR if the package includes it, but converting the whole DEB back will not recreate the original package setup or any files that were omitted or changed.

Additional formats for
jar file conversion

Reverse conversion

Convert to deb from
other formats

Share on social media:

Already downloaded

This file has already been downloaded. For your privacy it was deleted from our server right after the download, so it cannot be downloaded again. To get it once more, convert the file again.