Can Java 7 use Apple Java Extensions? - macos

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.

Related

How to fix JEdit 5.1.0 to don't complain about Java SE 6?

I have Mac OS X 10.9 and Java SE Runtime Environment (build 1.7.0_17-b02)... I had another version of JEdit (I guess JEdit 4) and Java 6 before and my JEdit was working fine.
Then I upgraded Java to Java 7 because NetBeans7.4 needed to be installed with Java 7 (and I needed this new NetBeans because I had a fatal issue with NetBeans 7.3.1). So anyway, I installed Java 7 and I installed NetBeans 7.4 and my netbeans is working perfectly now, but when I tried to run the JEdit it brought up an alert saying it needs Java SE 6 to run!
I did some search in the net, and it seems that JEdit 4.5 (and I guess JEdit 5.1 too!) should not have any issue with Java 7, So I installed JEdit 5.1.0... I expected that it should work and don't bring up that complain alert BUT it didn't work and brought up "Java SE 6 is needed" complain again ...
I still can run JEdit using this command, but I can't use Cmd+C & Cmd+V shortcuts for copy and paste and it kills me!
java -jar /Applications/jEdit.app/Contents/Resources/Java/jedit.jar
Is there anybody who knows why JEdit 5.1 is complaining about Java 6 and how to fix it?! I really appreciate your help!
https://sourceforge.net/tracker/?func=detail&aid=3615181&group_id=588&atid=100588
After almost 3 months struggling with jEdit I'm ready to give up... I still can't run jEdit like a normal app. What do you suggest to replace my jEdit?! The main feature I need is realtime access to the server files... Most of editors keep a local version of files, so they don't show the changes when they are made in the server side. for example when I switch to a new git branch on server, my netbeans is still showing the branch that I was working before switching, so I need to do a complete download on the project. Any idea?!
#Monica About one year later after your question, I've experienced the same issue with Mountain Lion (according to jEdit's homepage, 5.1.0 is still the current stable version).
I've installed jEdit in /Applications/Dev/ (not /Applications as most people do, I believe; that's not important except for designating the path, see below). I'm using Java 7.
The following works for me from the command line, like for you:
java -jar /Applications/Dev/jEdit.app/Contents/Resources/Java/jedit.jar
So, I used Automator to create a normal MacOS Application named "MyJEdit.app" as in the screenshot. Now I can launch MyJEdit instead of jEdit. Other java flags might be required, for instance to set the memory usage (cf java -help and java -X).
jEdit on Mac OS X and Java 7 is a long story of annoyances, and fine points that Apple did not get quite right up to Java 6, and Oracle still learning about native platform support in the past 1-2 years.
Starting with Jdk-7u40 it works technically quite well, even Retina displays, but jEdit needs to be adapted slightly.
jEdit 5.2 will probably work with Java 7 out of the box, but a few points are still open. See also the tracker item 3615000 at Sourceforge.
Here is a practical proof that it works: Isabelle/jEdit -- it is an application based on jEdit that is bundled differently than official jEdit 5.1.0.

Java 7 installer for Mac/Windows

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

Is it possible to run NetBeans and BlueJ on Mac OS X without incompatibility?

I would like to play around with the Java SE version of NetBeans on Mac, however I need to still have a running copy of BlueJ on my Mac for a school class. Is it possible to run the "JDK-only" BlueJ and the "Java SE" NetBeans together in harmony?
Try it and see. My Mac maintains several versions of Java although I don't really know what gets used where.
It might be worth looking at this FAQ: http://www.bluej.org/help/faq.html#macjava5

Blackberry Development on Mac OS X

I recently started creating applications for mobile devices and have successfully completed an application for the iPhone. I am now turning my attention to the Blackberry but haven't been able to find a convincing article or website that states that it can be done or a tutorial on how to do so. Can Blackberry apps be developed on Mac OS X? If yes, how do I go about doing so? Can anyone please point me in the right direction as I only have access to a Mac and really want to get this project on the road. Thanks in advance for your help.
UPDATE:
RIM has released a MacOS Eclipse plug-in for Blackberry Development: http://na.blackberry.com/eng/developers/javaappdev/macosx.jsp
While there is no built-in simulator, the plug-in DOES support USB tethered device debugging for the Torch 9800 handhelds. I plan to get one; they are ~$499 w/no contract. With a Torch and the new plug-in, Blackberry development is possible without using a VM. (Finally!)
PREVIOUS POST:
Building on MacOS works well once you set it up. I've had less luck with the simulator. On the whole though, being able to run Eclipse natively in MacOS and flip to a Windows VM only for debugging is a big win in my book.
You can get a MacOS version of preverify (see link below for details). I do my development with Eclipse on MacOS X and use Ant to build BB apps.
This blog is excellent and has many of the details to get you started:
http://www.azizuysal.com/2009/07/blackberry-development-on-mac-os-x.html (original link is dead. The "wayback machine" provides us with the original text content, but images and styling are lost to the sands of time. Still worth a read.)
The tricky part is getting the simulator to work. There is a Wine-based work-around, but on my computer, while the simulator was able to run under Wine, the LCD output was scrambled.
Currently, I build COD files from Mac, and my Ant build process drops them into a directory that is shared with a WinXP VM. I can run the simulator stand-alone in this VM. Debugging is also possible by installing Eclipse inside WinXP and pointing the debug configuration it at the source directories.
I've actually got a bit more magic. I enabled some of the Java 1.5 features by compiling against 1.5 and then translating the bytecode to 1.3 prior to the preverify script. (Blackberry only speaks a barbaric 1.3 java, flashback to circa 1992). It's not a silver bullet as some features still don't work, but it does cut down on the need to make everything an untyped Object reference.
Lately, I've been working on a x-platform framework to allow me to write app code once and build against both Android and Blackberry (both are Java). The Android part was easy. It's just a bitch to debug anything in Blackberry. Someone working at RIM decided that Blackberry didn't need to keep Exception stack traces unless there was a catch(Throwable), and then they could do something bizarre, non-standard, and undocumented (catching Throwable behaves weird). I've only kinda-sorta figured out a hack to get stack traces using JavaLoader.exe without breaking into the debugger, and it's barely worth it.
p.s., I now do x-platform development with a single code-base targeting Android, Blackberry, and Desktop. Desktop is great for testing app functionality, with very little Blackberry on-device testing needed once features work in the desktop 'simulator' (a Swing GUI built for debugging our games).
Even though certain components of the RIM development platform are java-based, such as the JDE - other components such as the preverifier and device simulators are implemented as native Windows executables.
Basically, the easiest way to do it is to install Windows on your Mac using Bootcamp or Parallels and run inside a real Windows environment on your Mac.
However, there are other "hackier" ways to do it using Wine, MacPorts, and a number of other tools - as an example see this blog post

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