Java 7 and 6 on Mac OS X 10.8.2?

Hi,

on my Mac with OS X 10.8.2 was installed Java 1.6.0_37.
Today I have installed the jdk-7u11-macosx-x64.dmg from the Oracle downloads site without an uninstall of the Java 6 version.
If I check now the Java version by Terminal with the command “java -version” I get the output:

java version "1.7.0_11"
Java(TM) SE Runtime Environment (build 1.7.0_11-b21)
Java HotSpot(TM) 64-Bit Server VM (build 23.6-b04, mixed mode)

But the Servoy Server Status of servoy-admin shows:

JVM Information
java.vm.name=Java HotSpot(TM) 64-Bit Server VM
java.version=1.6.0_37
java.vm.info=mixed mode
java.vm.vendor=Apple Inc.

I don’t understand this issue. Is it possible to switch between the Java versions or do I have to uninstall the Java Version I don’t want to use?

Regards

Could it be that the Servoy 6.1.3 developer is automatically and exclusive running with Java 6??

Because if only Java 7 is installed on a Mac OS X 10.8.2, I get the error that the servoy.app will run only with Java SE 6 runtime!?

Regards

Check out the “requiredJavaVersion=1.6” from the servoy.ini file:

-clean
-startup
../../../plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar
--launcher.library
../../../plugins/org.eclipse.equinox.launcher.cocoa.macosx.x86_64_1.1.101.v20120109-1504
--launcher.XXMaxPermSize
256m
-vmargs
-Dnativeswing.interface.inprocess.useExternalSWTDisplay=true
-Dnativeswing.dependencies.checkVersions=false
-Dsun.awt.disableMixing=true
-Dosgi.requiredJavaVersion=1.6
-Xms80m
-Xmx1024m
-XX:MaxPermSize=512M
-XstartOnFirstThread
-Dorg.eclipse.swt.internal.carbon.smallFonts

Right-click the Servoy developer app icon and choose “show package contents”. You’ll find this file in “Contents/MacOS/servoy.ini”.

It’s just a settings file so it’s ok to monkey with the contents. We haven’t tried Java 7 out yet ourselves so would be interested in what it takes to get working if you figure it out.

The servoy.ini file installed in my Mac OS X 10.8.2 doesn’t have the “requiredJavaVersion=1.6” line. This is it

-startup
…/…/…/plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar
–launcher.library
…/…/…/plugins/org.eclipse.equinox.launcher.cocoa.macosx.x86_64_1.1.101.v20120109-1504
–launcher.XXMaxPermSize
256m
-vmargs
-Xms40m
-Xmx1024m
-XX:MaxPermSize=256M
-XstartOnFirstThread
-Dorg.eclipse.swt.internal.carbon.smallFonts

I however added the requiredJavaVersion=1.7 line but Servoy Developer still refuses to run if no Java 6 is installed

@David thank you, but the same for me like @rioba has posted.

At this moment, I don’t think Servoy is running multiplatform as well.
I have so many trouble to get the customers solutions running on their Macs, but I believe the Servoy guys do their best and Apple causes the problems, or?

Regards

Theoretically this servoy.ini file should work (with the line following vm pointing to the path for your JDK):

-startup
../../../plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar
--launcher.library
../../../plugins/org.eclipse.equinox.launcher.cocoa.macosx.x86_64_1.1.101.v20120109-1504
--launcher.XXMaxPermSize
256m
-vm
/Library/Java/JavaVirtualMachines/1.7.0.jdk/Contents/Home/bin/java
-vmargs
-Dosgi.requiredJavaVersion=1.7
-Xms40m
-Xmx1024m
-XX:MaxPermSize=256M
-XstartOnFirstThread
-Dorg.eclipse.swt.internal.carbon.smallFonts

See http://wiki.eclipse.org/Eclipse.ini for more details.

However, there is a bug with Eclipse where specifying the vm doesn’t work on Macs. For the record, it seems more like a by design decision to me. Either way you cut it, specifying the vm in this way will not work on Mac OS X.

About a year ago, I played around with getting Servoy Developer to use the JDK from Oracle and this answer helped:
http://stackoverflow.com/questions/10352715

One thing to remember if you go this route is that neither servoy.ini or Info.plist are used with this setup. So you’ll need to add the missing java-related lines from both.

Here is the servoy.sh file that worked for me:

#!/bin/sh
#

export JAVA_HOME=/Library/Java/JavaVirtualMachines/1.7.0.jdk/Contents/Home
LAUNCHER_JAR=../../../plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar
LAUNCHER_LIB=../../../plugins/org.eclipse.equinox.launcher.cocoa.macosx.x86_64_1.1.101.v20120109-1504

java \
-showversion \
-XX:MaxPermSize=256m \
-Xms40m \
-Xmx512m \
-Xdock:icon=../Resources/servoy.icns \
-XX:+UseParallelGC \
-XstartOnFirstThread \
-Dorg.eclipse.swt.internal.carbon.smallFonts \
-Dnativeswing.interface.inprocess.useExternalSWTDisplay=true \
-Dnativeswing.dependencies.checkVersions=false \
-Dsun.awt.disableMixing=true \
-Dosgi.requiredJavaVersion=1.6 \
-jar $LAUNCHER_JAR \
--launcher.library $LAUNCHER_LIB

Although I met with some success at the time, I didn’t wind up actively using it because Eclipse 3.6 (the version used in Servoy 6) was pretty unstable with Java 1.7 on the Mac. I’m trying to get it to start up now and I can’t; probably I updated the JDK since then or something. In any event, I’d be interested to know if you’re able to get this working.

Thank you Troy for your detailed post!

If I have a bit more time I will play with this and try to get this working. But new versions of Servoy and Java require changing the settings, or?

Normally it would be the best for me to stay on Java 6 without major problems and make the change to Java 7 if all Servoy stuff is unrestricted running with it.

In Servoy and Oracle we trust 8)

tgs:
At this moment, I don’t think Servoy is running multiplatform as well.
I have so many trouble to get the customers solutions running on their Macs, but I believe the Servoy guys do their best and Apple causes the problems, or?

tgs:
Normally it would be the best for me to stay on Java 6 without major problems and make the change to Java 7 if all Servoy stuff is unrestricted running with it.

A developer running Servoy developer and customers running Smart Client are two different issues. As you say, for a developer just don’t move to Java 7. I’m still on OS 10.6.8 for that matter. I’m due for a new machine this year though and every time I get one – making sure everything works is a process that I don’t look forward to.

As I’ve mentioned in other threads before all the recent Java issues, targeting customers with Smart Client is a dead end in my opinion. It’s either get on the browser bandwagon as fast as you can or call it quits.

From this perspective, I believe Servoy is still very much multiplatform.

Now I have checked out (tried) a bit more on my main developing iMac with Mac OS X 10.8.2, Java 1.6.0_37 and 1.7.0_13.

Servoy 6.1.3 developer opens and runs with Java 6, also the debug client. I have no need to run the Servoy dev. with Java 7 if it is working well with Java 6 and both installed Java versions could be managed without occurring problems on my Mac. So this should be totally ok for me.

If I open a Smart Client from an Application Server, the Java 7 JRE is starting automatically and the solution is working fine.

On other Computers my Servoy 5 and 6 solutions are working with Java 7 without problems on Win XP → 7 and Mac OS X 10.6.8 → 10.8.2.
I’m very happy with this. :D

Java vs. Mac story - (URL removed by moderator)

Excuse me ? A story on how to Uninstall Java posted in a forum of a Java based tool?
Sounds like click-bait to me. Not at least because this has been your first post even.