How to prepare a Mac installer for my java swing application - java

Can anybody give me suggestions about preparing a custom Mac Installer for a Java swing application. I have tried Xcode but of no use. Any suggestions would be really helpful.
Thanks in advance...

Take a look at http://izpack.org.
IzPack-generated installers only require a Java virtual machine to run. It is fully cross-platform and generates a single installer. As such, it is an alternative to native solutions like as platform-specific installers and package managers.
Or for a more Mac-specific option, see this 10-step tutorial:
http://www.centerkey.com/mac/java (Updated for Mac OS X 10.6 — Snow Leopard)

Do you actually need an installer? Unless you need to put files in very specific locations and need admin privileges for that, installers are uncommon on the Mac. Typically, you'd use a disk image with a self-contained application bundle. See my answer to this question. That answer also mentions how to create a standard OS X installer.

Related

Setting value for Publisher, Size, and Version in Win 7's Programs and Features for a Java app

I have a Java application that is running on Windows 7. When I look at the uninstaller inside control panel>Programs and Features I see that other apps have values for Publisher, Size, and Version.
I would like to set these values in my application, but I do not know how.
Could any of you kind people please point me to an article or explain to me how I can accomplish this? I've done a bit of searching but I am not coming up with anything.
Thank you,
Mattimus
I believe another alternative is to add these values directly to the registry.
http://msdn.microsoft.com/en-us/library/aa372105(v=vs.85).aspx
I don't know how "best-practice" this is, but it's basically what the windows installer is doing.
This come from .MSI files, which are Windows Installer files.
If you want your Java application to be visible in Add/Remove programs you have to build an .MSI file. These are usually built by installer tools such as http://www.advancedinstaller.com/ which has Java support.
Microsoft provides free installer tool Wix http://wix.sourceforge.net/ which is slightly harder to use than the one above, but it is free.

Select SWT Library depending on OS

How do I ensure when I distribute a JAR-file that the proper SWT-library (either the windows, the linux or mac version) is loaded an ready to use?
It would be very helpful because then you can do one export and your application can run on any platform like Swing apps usually do.
Thanks a lot
This can be done with a loader class as described in this answer: Create cross platform Java SWT Application
You looking for the delta-pack. The delta pack archive contains all the platform specific fragments from the Eclipse SDK.
See http://aniefer.blogspot.com/2009/06/using-deltapack-in-eclipse-35.html
Thanks a lot for the answer.
Sounds like I have to distribute my app per platform.
In comparison to Swing this is a disadvantage, but I love the native widgets ;)

How to make installer of java desktop application for multi-platform?

How could we made a jar file's installer, which can run on multi-platform. Is there any simple way, because I don't know Java much well.
Balwant
Installer tools for Java have been dealt with in quite many questions on SO, and most options have probably been mentioned already:
What’s the best way to distribute Java applications?
Java Application Installers
What is the best installation tool for java?
See also other questions tagged java+installer.
If a commercial tool is ok, the best multi-platform installer for Java software, to my knowledge, is install4j; I can definitely recommend it (more about my experiences with it).
Nearly half of our BitRock InstallBuilder customers use it for Java deployment. It is multiplatform and runs in all the major platforms such as Windows, Linux, Mac, Solaris, HP-UX (and most of the obscure ones too :)
izPack is pretty nifty and supports multi-platform installations.
If the target audience have access to the web, you could have a look on Java Web Start which allows you to basically do all you need.
It requires the user to click a link and download.
Well the best way is to use InstallAnywhere that is good for install or packagging any of the applicaion in desktop.
here theInstallAnywhere go to site register your self and download one trial verson.

Running .exe files in Mac OS X

I am a Mac user who wants to run a few .exe files from my Java process using Process and Runtime classes.
I know that it is not possible to execute .exe files in general in Mac OS X.
Is there a Mac application which can wrap these .exe files so that they can be executed ?
Does Apple provide anything by itself ?
The alternative I am using now is to run the Java process in Windows. Yet, it is cumbersome in general.
Darwine
Edit: I should probably point out that this is not a 100% solution. Virtualized Windows will nearly always work better, through Parallels or some similar virtualization software. But Darwine is free and runs most Windows software acceptably.
Besides wine you can get VirtualBox(free), Parallels($$$) or VMWare($$$).
Well, if it's a .NET application then you can possibly run it with Mono, but I'm betting it's a native binary and you'll have to use something like the aforementioned Wine. I thought it was really cool the first time I ran a .exe using Mono on OSX, it just felt wrong, so I had to share.
I don't know if it exists, but you would need something like wine for OSX. The reason why is that the .exe would nearly certainly use OS specific system calls and library functions.
EDIT: looks like it does exist
java -jar file.exe and monofile.exe both works natively on MACOS with native MACOS java and mono
1)Install Wine and Winebottler from http://winebottler.kronenberg.org/
2)You may have to change the System Preferences >Security & Privacy>Allow Apps downloaded from>Anywhere
2)Click the xyz.exe and select winebottler for running application

React on global hotkey in a Java program on Windows/Linux/Mac?

A Java6 application sits in the system tray. It needs to be activated using a hotkey (e.g. Super-G or Ctrl-Shift-L etc) and do something (e.g. showing an input box).
How do I do that on:
Windows (XP or Vista)
OS/X
Linux (Gnome or KDE)
I've compiled a library for global hotkeys in java using JNA. It currently supports Windows, Linux and Mac OSX. It also supports media keys on windows and linux.
if anyone is interested, try https://github.com/tulskiy/jkeymaster
I would appreciate any feedback.
Thank you.
For Linux (X11) there is JXGrabKey: http://sourceforge.net/projects/jxgrabkey/
There is also a tutorial for grabbing a global hotkey on Linux: http://ubuntuforums.org/showthread.php?t=864566
I didn't though find a solution for OS X yet.
To build something for all 3 platforms I'd suggest stripping down JIntellitype (it's Apache license) to it's global hotkey functionality and extending it with the OS X and X11 functionality...
It seems that this is not doable in a cross-platform fashion without using the native interfaces.
On Windows, you can use the free JIntellitype library.
If anyone wants to do the OSX or Linux versions of the JNI part of Jintellitype I would be more than happy to add those to the JIntellitype library.
Melloware
http://www.melloware.com
I found this solution to work just great on windows. It does not require you to install any software like JIntelliType. Note that this is 32 bit dll and you can recompile for 64-bit JVM is do desire. All credits to original author of the blog.
I've written a Java library for global key/mouse events here. This works for Windows, Linux X11, and OSX.
https://github.com/repeats/SimpleNativeHooks

Categories

Resources