Building Debian Packages in Java

A truely platform independent way to build Debian packages without the native tools.

| |

Using native packaging formats to install Java applications leverages existing and well tested tools and infrastructe for software deployment. But one of perks of Java has always been the cross platform build. Using the standard native tools to create these native packages breaks the promise of a cross platform Java build.

With the jdeb project there is a way to create native Debian packages directly from your ant or maven build. It let’s you create

Debian packages with without using the native tools.

So whether you build on Linux, Windows or macOS you get a valid package that is ready to be deployed.

The only requirement is the control file that provides meta data about the package. It declares things like name, version and most importantly dependencies.

Package: [[name]]
Version: [[version]]
Section: misc
Priority: low
Architecture: all
Description: [[description]]
Maintainer: Torsten Curdt <>
Depends: default-jre | java6-runtime

The integration is easy with ant. Just specify the paths and provide the data that should get included into the package.

  verbose="true" >
  <data type="file"
    src="${build.dir}/jar/${}-${version}.jar" >
    <mapper type="perm" prefix="/usr/share/jdeb/lib"/>
jdeb usage from Ant

With maven jdeb attaches to the package phase. A build now creates the jar then builds the package and attaches it as seconday artifact.

jdeb usage from Maven

For more information check out the documentation and the examples or join the community for a chat on gitter.