easily making executables, installers, debs, etc.

F

fft1976

Are there tools for easily creating installers from jars for various
platforms? Ideally, the installers would be native and would check
whether jvm is installed and do something user-friendly if it's not.
 
A

Andrew Thompson

Are there tools for easily creating installers from jars for various
platforms?
JWS*.

..Ideally, the installers would be native and would check
whether jvm is installed and do something user-friendly if it's not.

deployJava.js*.

* if it has a GUI.
 
C

cbossens73

If you're targetting Mac users then these users will expect
your Java app to be packaged in the same way as most Mac
application are packaged.

Apple recommends Java apps to be shipped as a .dmg file for
OS X users.

JarBundler can be used on OS X to that effect.

I'm working on an app that is deployed on countless of
various different configs. For Linux and Windows it's
a unique .jar (with jars packaged inside the .jar) while
for OS X we package our application in the way recommended
by Apple: in a .dmg file.
 
J

John B. Matthews

If you're targetting Mac users then these users will expect
your Java app to be packaged in the same way as most Mac
application are packaged.

Apple recommends Java apps to be shipped as a .dmg file for
OS X users.

JarBundler can be used on OS X to that effect.

I'm working on an app that is deployed on countless of
various different configs. For Linux and Windows it's
a unique .jar (with jars packaged inside the .jar) while
for OS X we package our application in the way recommended
by Apple: in a .dmg file.

This is good advice. A bare JAR works fine on Mac OS X, but only modest
effort is required to wrap the archive as an application with JarBundler
and package it with DiskUtility. Alternatively, both .app and .dmg can
be constructed via build.xml:

<http://robotchase.svn.sourceforge.net/viewvc/robotchase/trunk/>

Java Web Start is a more compelling choice for target platforms that
lack a vendor-supplied JVM, but it works fine on Mac OS X, which does:

<http://robotchase.sourceforge.net/RobotChase.jnlp>
 
F

fft1976

deployJava.js*.

* if it has a GUI.

I was talking about Java applications that seem native to the user
(during installation) with no relation to the browser, i.e. *.msi for
Windows users, *dmg (or whatever) for Mac users, *.tar.gz, *rpm and
*.deb for Linux users.

It would seem that the work that needs to be done packaging a pure
Java application into these does not depend on the particular Java
application very much, except for minor configuration details. So I
expected this processes to have been streamlined already.
 
O

Owen Jacobson

Are there tools for easily creating installers from jars for various
platforms? Ideally, the installers would be native and would check
whether jvm is installed and do something user-friendly if it's not.

For .deb, I'd consider using the deb-maven-plugin from Codehaus:
<http://mojo.codehaus.org/deb-maven-plugin/using-deb.html>

However, I've never used it so I can't speak for how well it
does/doesn't work, and if you're not already using maven, the migration
may be more than you want to bite off. The biggest gotcha that I can
spot is related to generated dependencies: I'm not sure how well its
autoGenerateDepends directive works, so do some experiments.

There is a similar plugin for RPMs:
<http://mojo.codehaus.org/rpm-maven-plugin/>

I don't see an MSI plugin floating around, either on codehaus or
anywhere else. Java programs are pretty close to xcopy-installable by
default, unless you have strange beliefs about installing JARs
"globally" to the system -- don't do that, it's against the grain of
Java's deployment model in practice. Both Redhat and Debian have gone
to a lot of lengths to fake global library installation, but even with
all the manpower spent, it's not great.

Building a Mac .app bundle is probably better done through the assembly
plugin, since Java .apps are little more than directory trees. Details
on the correct structure are available online:

<http://developer.apple.com/document...apple_ref/doc/uid/TP40001885-208447-TPXREF120>


(<http://tinyurl.com/ct2mlg>)

As for the assembly plugin itself, the documentation for it is at:
<http://maven.apache.org/plugins/maven-assembly-plugin/>

To bundle it up as a .dmg, you'll need to run something like
$ hdiutil create -srcfolder root-of-distribution my-project-1.0.dmg
$ hdiutil internet-enable -yes my-project-1.0.dmg

(The internet-enable step is semi-optional but I do wish more DMGs
would use it.)

For a few bucks I'd be happy to write and release as open source a
maven plugin that ties together the steps in building a complete .dmg
from a JAR project; it's not hard, but it's not something I
particularly care about doing ferfree. :)

HTH.

-o
 
M

Mark Space

fft1976 said:
I was talking about Java applications that seem native to the user
(during installation) with no relation to the browser, i.e. *.msi for
Windows users, *dmg (or whatever) for Mac users, *.tar.gz, *rpm and
*.deb for Linux users.


I believe most standard windows installers can be customized to install
Java programs, although I haven't tried it. This one advertised
explicit support for Java:

http://www.advancedinstaller.com/java.html


Here are a few ones specific to Java. I haven't tested any of them.

<http://java-source.net/open-source/installer-generators>
 
F

fft1976

[...]

It's possible to make installers for various platforms, and it's not
TOO difficult. The problem is that there are MANY of them, also user
friendliness is an issue. What will the installer do if there is no
JVM? Native binary splash screen while the JVM is starting, etc.?

After searching the net for a while, I realized that the only tool
that claims to have the features I want is a commercial one,
install4j, and is rather pricey at $1200/developer, but probably pays
for itself in the productivity saved, assuming its quality is good.

Strange that Sun, IBM or the open-source community haven't solved this
for Java yet.
 
O

Owen Jacobson

[...]

It's possible to make installers for various platforms, and it's not
TOO difficult. The problem is that there are MANY of them, also user
friendliness is an issue. What will the installer do if there is no
JVM? Native binary splash screen while the JVM is starting, etc.?

After searching the net for a while, I realized that the only tool
that claims to have the features I want is a commercial one,
install4j, and is rather pricey at $1200/developer, but probably pays
for itself in the productivity saved, assuming its quality is good.

Strange that Sun, IBM or the open-source community haven't solved this
for Java yet.

That's also highly platform-dependent. The only OS where it's even an
issue is Windows, though:
- .deb and .rpm files can declare dependencies on the Debian/Ubuntu
and Redhat Java meta-packages, which the respective package managers
can deal with.
- OS X has a 1.5 JVM pre-installed; 1.6 is also available via the
platform's software updater for 64-bit CPUs. Apps do not install JVMs.
- Windows doesn't have either a preinstalled or a standard package for
the JVM, so you need to include the Java MSI in your own and offer to
install it if it's not already installed. I haven't read the license,
so I don't even know whether this is actually allowed.

-o
 
C

cbossens73

On 2009-04-16 01:30:18 -0400, fft1976 <[email protected]> said: ....
- Windows doesn't have either a preinstalled...

I don't disagree with what you're saying but actually a lot
of OEM Windows PCs are packaged with Java pre-installed.

Most laptops (> 50% of PC sales), all Dells, etc. ship
with Java pre-installed.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,733
Messages
2,569,440
Members
44,831
Latest member
HealthSmartketoReviews

Latest Threads

Top