using packagemaker on mac os - java

i want to make the installation package on the mac os of my java application using the package maker. is there any one having the link that will show step by step guidance for performing this.

See Java Deployment Options for Mac OS X on the Apple Developer site. Here's an ant build.xml file with targets to compose a Mac application bundle and create a .dmg disk image. Alternatively, consider using Java Web Start, also supported by that project.

Related

Java applications for mac

I have never used mac before so I have a question about best way of running java application on mac, since I didn't really find a good answer online.
So I've build a java application and I have to send it to a client that is using mac. I know that you can run .jar on mac using java -jar app.jar from terminal, but I want a double-clickable icon that a client can only click on and start the program.
I've seen some tutorial where someone has made a .jar file that you only double click on and the program starts in macos, so I am not sure if you can run a .jar in macos as executable only by double clicking on it?
One other solution that I saw was to make a simple .command file that would run the app using java -jar app.jar. So I want to know what is the best way of making an executable for mac from a .jar file?
Yours isn't a bad question.
The answer is "it depends". It's entirely possible the "best solution" is to simply send the .jar file with instructions for invoking it.
Please look at the Oracle documentation:
Java Documentation Section 7: Self-Contained Application
Packaging
7.1 Introduction
The Java packaging tools provide built-in support for several formats
of self-contained application packages. The basic package is a single
folder on your hard drive that includes all application resources and
the JRE. The package can be redistributed as is, or you can build an
installable package (for example, EXE or DMG format.)
From the standpoint of process, producing a self-contained application
package is similar to producing a basic application package as
discussed in Chapter 5, "Packaging Basics," with the following
differences:
Self-contained application packages must be explicitly requested by passing additional arguments to the Ant task or
javapackager tool.
Operating system and tool requirements must be met to be able to build a package in a specific format.
Self-contained application packages can only be built using JDK 7 Update 6 or later.
While it is easy to create a basic self-contained application package,
tailoring it to achieve the best user experience for a particular
distribution method usually requires some effort and a deeper
understanding of the topic.
...
7.3.5.1 OS X
The resulting package on OS X is an "application bundle".
Several configuration parameters are placed in the Info.plist file in
the application bundle and must conform to the following rules:
Application ID (or main class name if ID is not specified) is used as CFBundleIdentifier.
Application version is used as CFBundleShortVersionString.
OS X 10.8 introduces Gatekeeper, which prevents execution of untrusted
code by default, regardless of whether this code is implemented in
Objective-C or Java.
The user can manually enable the application to run, but this is not a
perfect user experience. To get optimal user experience, obtain a
Developer ID Certificate from Apple. The Mac bundler uses the
certificate to sign the .app folder. If your local user information
differs from the name of the certificate, you might need to set the
bundle argument mac.signing-key-user-name, as shown in the following
example:

How do I make an installer for my java program which also installs mysql?

When the program is installing on windows, I want the installer to check if mysql is installed, and install it if it isn't (Or at very least give a link to the website so the user can install it)
I'm sure this is possible, I've been trying to figure this out for a while now. If you can have an installer check if the user has java installed and install it if they don't, then surely you can do the same for mysql?
Perhaps I'm looking at this the wrong way - should I instead be getting the java program to check if mysql is installed and install it then if it isn't? And if so, how do I do that?
Any help would be hugely appreciated, I've been stuck with this for a long time.
I refer to this answer.
Java is cross platform, MySQL isn't, so you'd have to create various installers for multiple platforms with different MySQL binaries.
My suggestion is to have a look around the web in order to find the correct way to create an installer depending on the OS you're using
Installer is usually created for OS (Windows, Linux). In our case we created deb package (for Debian) which checked if PostgreSQL and other prerequisites are installed and installed what is missing. So, basically it is job for installation script (in our case it was shell).
Wix installers along with .bat files you can use.
http://wixtoolset.org/
It has built-in directives that can check if software is installed or not, outdated version notifications also.But WIX is kind of a database of your software binaries.So you have to include the binaries of MySQL(whichever are supported on windows) in the installer using harvest wix utility.
http://wixtoolset.org/documentation/manual/v3/overview/heat.html
This will just copy the binaries in your target directory if the software is not installed, you have to write all this logic to skip or install using wix directives/conditional custom actions .To do after copy stuff like starting or configuring the service either write a bat/powershell file which will handle all this and you can invoke this powershell file from wix after the copy action using wix custom action directives.
http://wixtoolset.org/documentation/manual/v3/wixdev/extensions/authoring_custom_actions.html.
Or you can write all the steps of bat files in many different custom actions.You will need visual studio to create this installer.In the begining it will be trouble to understand how it works but this is the best way to create production level deployment/product installers for microsoft suite.

My application won't open for Mac OS users

Recently, I have created my first public Java application, which opens a simple GUI. I have tested it on my Windows PC, but someone reported that the file does not open on their Mac OS.
Since I do not have anything running a Mac OS to test it, I'd need your help to tell me if there are differences when building the JAR file...
Because for all the people with Windows, it does work.
Is it something while building the JAR file? Or some part of the code would be different for Mac OS?
Thanks!
Jar files are designed to run on any OS that has a JVM of a compatible version installed. Some jar files, however, may have be compiled from Java code that used OS-specific code (say talking to Windows registries), so testing it on other OS's is wise.
Original post by Kathy Van Stone can be found here.
It ended up it was a security error, fixed by them with tips from the Apple.com page (here)
Thanks!

Open PDF file in Android

Hello I want to open PDF file in Android app, I found this apv pdf reader in code.google and it is recommended by alot.
I checked the setup page and it is assume you are using Linux and I am Windows user + I am not good in configure libraries.
Can you show me how to configure it in windows and integrate in my app?
OR
if there is good tutorial for that?
The instructions provided work for Windows as well. You need to install cygwin and then follow those instructions from a cygwin prompt to build the libraries. It looks like you'll also need to install Android NDK.

Convert .jar to an OSX executable?

I made a Java application which I would like to distribute on Windows, OSX and Linux without distributing a jar file. I used the great Windows exe wrapper http://launch4j.sourceforge.net/ to create an .exe file complete with my icon that won't scare Windows users.
Are there similar wrappers that I can use for OSX/Unix? An important consideration is that I would like to have my own icon on the executable (especially for mac users).
Thanks!
Yes, on Mac OS X there is a program called Jar Bundler that is installed when you install the free (assuming that you already own a copy of Mac OS X) Xcode Developer Tools that allows you to bundle a JAR file inside a native Mac OS X "*.app" application bundle with a nice and shiny icon just like other apps.
Update
The JAR bundler doesn't exist on later versions of OS X. As a workaround, you can manually create an OS X project that invokes Java. Or, there are a variety of build system extensions that do a similar thing; for example, the gradle-macappbundle plugin for Gradle will create such a wrapper app.
JarBundler is obsolete, but there is a (better) official replacement: the javapackager tool.
For OSX, A simple, well explained, step by step tutorial on how to create a DMG from java is here: http://centerkey.com/mac/java/ . For other platforms, you just need to modify the example by using the proper switches in javapackager.
If you do not have a Mac to build this on (or want to integrate it into an existing build chain), you might want to have a look at the OS X Application Bundle Plugin for Maven.
This will (if run on Linux or Windows) create a zip that will unzip as a proper Mac application. If you run Maven on a Mac, it can also make a DMG.
You can also package your application with the JarBundler Ant task:
http://informagen.com/JarBundler
<jarbundler dir="release"
name="MyApp"
mainclass="org.foo.myapp.Main"
jar="myapp.jar" />
Github user Jorl17 made an excellent Python script called jar2app that does this with one simple command. It even lets you customize the app icon.
https://github.com/Jorl17/jar2app
Just install it, follow the instructions, and you get the .app file.

Categories