Java 7 installer for Mac/Windows - macos

I am programming software in Java 7. The users of the software are not all up to date (especially the Mac users). Therefore I need an installer (Windows/OSX) that can be easily integrated with the software installation. There is a normal installer for Windows 7 so I am especially focused on finding one for the Mac. Bonus points if it can check for XCode and other requirements too).
I am thinking another option would be to just use some of the libraries from Java 7 (for example the file-system library). However, I think this might not be possible due to the version number in the compiled classes? I couldn't use a Java 6 compiler to compile these libraries either (because they are Java 7 code).
I don't think I am the only one with this problem. There must be a solution somewhere, but I haven't found it.
Any help would be appreciated.

For the best user experience I would recommend using PackageMaker to create a .pkg file which you can then give to your Mac users. That allows them to do a single click-to-install of your app.
Within the package you would bundle your app archive (JAR file), any necessary resources and two scripts, one to check for the existence of Java 7 on the target system, and the other to install it if not found. I would recommend bundling the latest version of OpenJDK7 with your pkg, at least until an official Java 7 SDK is released for the Mac.

JAva 7 is not yet officially supported on Mac OS X, if you are looking for a JAva 7 installer for mac Os X take a look at openjdk-osx-build project on Google Code.

Update: You shouldn't need Java 7 for what your doing.
A better solution is to use Java 6 + Third party JNI libraries (i.e: JNotify,JavaXT...)
Directory listener in Java using JNotify
as for Last Accessed Date you might need to write tiny bit of Objective-C and pass it back via JNI
JNI Development on Mac OS X
Mac OS X already comes with Java runtime on Snow Leopard (JRE6)
On Lion it will automatically download JRE6 if application needs it's
You can of course download preview release of JDK7 from Oracle, but remember this is preview software there are some parts still not working yet (for example: Java Web Start)
Oracle JDK7u4 Mac OS X Port Developer Preview Release
Edit: Oracle JDK 1.7 Preview Release only supports Mac OS X Lion

Related

How can I run JRE 7 on Mac 10.6

This may be a longshot, but I NEED to get Java JRE 7 running on Mac 10.6. The official documentation states
Mac OS X System Requirements
Intel-based Mac running Mac OS X 10.7.3 (Lion) or later.
Administrator privileges for installation 64-bit browser
Is there any way I can trick the java JRE 7 into installing itself on OSX 10.6? Is there some community version of a JRE 7?
It can be done, just follow what this answer suggests. I successfully installed JDK 7 update 11 a couple of weeks ago. However I have only used it for some development, and am not sure if it runs e.g. Swing apps without issues.
No.
Easiest is most likely to install virtual box and run Ubuntu inside.
EDIT: The comments indicate that this is not for hobby use but a client. I would personally never base a commercial solution on unsupported software, and I hope it has been made absolutely clear to the client what this can result in.
A better solution might be recompiling your Java program for Java 6 (use the Eclipse compiler with -source and -target) and run it under Java 6. If you cannot do this - as you said NEED - then open a new question asking how to backport that facility to Java 6.

Can Java 7 use Apple Java Extensions?

In order to help Java apps look more like native apps when run on Mac OS X, Apple created the Apple Java Extensions in order to make Java apps behave more like Mac OS X. These allow for things like handling the behavior of the "About" menu and supporting drag and drop onto the application icon.
However, I can't find anything indicating whether or not these extensions are included with Java 7 or even usable with Java 7. It is my understanding that Apple merged their OS X implementation into OpenJDK, but I'm not sure whether these extensions went with it. I do see that the goal for the Mac OS X port of OpenJDK aims to "Include a complete, native Cocoa-based UI Toolkit", but I can't find much about what this entails. Searching the web has not proved very fruitful and I have no idea about if they are compatible with Java 7 or are even included.
So I guess I have three questions:
Will a Mac running Java 7 be able to use the Apple Java Extensions?
Are they included in Java 7, and if not, can I download them to bundle into my app?
Are there any alternatives to these extensions that are Java 7 compatible?
Will a Mac running Java 7 be able to use the Apple Java Extensions?
Yes. They are included both in the Oracle distribution and in OpenJDK. See the second answer here below.
I can't vouch for the complete API as I only need a subset to support drag-drop behaviour on the app icon and on the app frame. I can confirm though this works as expected with OpenJDK 7. No problems on the distribution side either, as the app is on sale on the Mac App Store.
Are they included in Java 7, and if not, can I download them to bundle into my app?
They are included in OpenJDK 7, you can find the sources in /src/macosx/classes/com/apple and supported by Oracle as hinted by the messages and bug fixes readable on the macosx-port-dev mailing list.
They are also included in the Oracle distribution, unjar rt.jar to see them.
You don't have to download anything, just start using them in your editor:
Are there any alternatives to these extensions that are Java 7 compatible?
Not that I know of, but I doubt you need an alternative.

Does Java 7 run on only x64 bit MAC OS X?

I want to deliver self-contained application packages on Windows, Linux and Mac so I have build my JavaFX application on all three platforms. I will allow my users to download these native bundles from my application's download web page but I have a confusion regarding MAC users because For Linux and Windows, JDK/JRE 7 comes in two download options
for x86
for x64.
but for MAC we have only option for x64.
Java Download Page shows Java/Jre is not available for 32 bit MAC OSX to run JavaFX application. Does it mean JavaFX will run on only x64 bit MAC OSX?
If it is so, then my issue has been solved, as I have already bundled my Javafx application as a "Self-Contained Application Packages" after run custom build.xml script on x64 MAC OSX but if it is not so, the user can also run JavaFX application on x86 MAC OSX but in that case my "Self-Contained Application Packages" for mac would not run on x86 MAC OSX.
So I am planning to give an additional zip file that either contains app (without copy of jre) or a plain self executable jar. But I'm bit worried regrading - what exactly I need to bundle into that zip file with self executable JAR so requirements must be met to be able to run my JavaFX application in following conditions?
conditions are : -
If user has x86 MAC OSX.
If java is already installed on user's system. And he would not like to download the "Self-Contained Application Packages" from our download page.
Big download size.
So what among the following two options suits if user have x86 MAC OSX or if he has already installed java on his system or he would not like to download "Self-Contained Application Packages" from download page due to big download size?
Option are -
APP ( without inbuilt copy of JRE)
Or only a self executable jar.
I am not sure that Mac OS X 10.7.3 (Lion) or later version can run on x86 system.So in case of #1 option the user may have trouble if he is using x86 system. Then he may need to change info plist file and replace the JavaAplicationStub.
In case of #2 option I think is better as the user need to download the JRE only and the JAR should run using "java -jar" command.
Please suggest which option is better in case if JavaFX application can run on x86 bit MAC OS X?
Does Java 7 run on only x64 bit MAC OS X?
Oracle Java 7 for OS X is only available for 64 bit architectures, there is no 32 bit version of the software.

Mac compiler on windows

Is it possible to develop cross-platform application on Windows and can also compile for Mac OS X from Windows? I have checked Qt but that requires one to compile from Mac using Xcode.
If this is your priority then one option would be Java as at least a jar file built on one platform can be run on another.
If however you're talking about C or C++...
If you are creating a small command line tool then you might be able to make this work with gcc and a cross compiler, but I think it would be a lot of work.
If however you are wanting to create a GUI application I would urge you to give up now. There are so many issues - you'd have to use Carbon or Cocoa APIs which you can't build for on any other platform, you'd have to link against frameworks which won't exist on your compilation host, you won't be able to easily generate .plist files. Qt won't help as you need to be able to build it, which relies on these same frameworks.
In short, there's no alternative to building on an actual mac.
Furthermore, when it comes to fixing bugs, you will absolutely have to do this on a mac (either physical or virtual).
From what I know , in general you do need a mac to make the executable , even for a simple ansi c program you need gcc for mac.
You can create MacPorts Portfile.(If your application is open source)
A MacPorts port is a set of specifications contained in a Portfile
that defines an application, its characteristics, and any files or
special instructions required to install it. This allows you to use a
single command to tell MacPorts to automatically download, compile,
and install applications and libraries.
Take a look at IMCROSS.
IMCROSS is a simple, scripted method of installing cross-compilers and
cross-compiled libraries on a Linux (or possibly other *nix) system,
so that you can develop programs targeted to run on Microsoft Windows
and Mac OS X at the same time and in the same environment as you
develop Linux versions of those programs.
You can certainly do this using Real Studio. It can create Mac OS X applications on Windows without any trouble.
It cross-compiles for Windows, OS X and Linux. And it does it from any platform. It also can create web apps.
Sounds like you should check it out.

I have an exe setup file. I want to make it compatible with Mac OS

I have an exe setup file. I want to make it compatible with Mac OS. Is there is any way through which we can convert an EXE to DMG, APP or a Jar?
No, you cant, you need to recompile the application for the target platform.
Nope*.
Moreover, if the contained software is compiled for Windows, it won't work on Mac.
If may work only if it is script-based (like in ruby, python, etc.). But usually, you'll have a proper Mac installation package when it is compatible.
**Exception*: some EXE are extractible archives, but it won't change the incompatibility if it is compiled for Windows.
The simple answer is to install software on a Macintosh OS you must recompile it down to a .dmg file. I jumped on Google and this article Creating a Mac OS X App from a Jar File was the second choice. The default Mac OS Java version was 1.5 for Leopard. Target 1.4+ and you should cover systems from at least Leopard and upwards.
As an aside, this tutorial was recently updated for Snow Leopard and covers the same stuff. Best of luck in getting it ported.
There are different distribution for Mac with have java6 and below version, for java 7 and 8 you need to make another app to run and compatible with
I did it on my way:
Create exe/ setup for your jar.
follow the link ---> winebottler.kronenberg.org
download winebottler(GUI based tool) for your mac type and simply follow this link below
https://www.youtube.com/watch?v=imPGlqEuYBk
No extra burden for you to how.
Note: This will pack your setup in app but app size will increase.

Resources