Cayenne
  1. Cayenne
  2. CAY-1881

CayenneModeler (Mac version) doesn't work with Java 7

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 3.2M1
    • Fix Version/s: 3.1RC1, 3.2.M2
    • Component/s: Modeler
    • Labels:
      None
    • Environment:
      Mac OS X 10.9 Mavericks
      Oracle Java jdk1.7.0_45

      Description

      The Mac specific CayenneModeler 3.2M1 doesn't work when the only java on the Mac is jdk1.7.0_45. The symptom is it won't open. I tried installing it again, but OS X Mavericks says CayenneModeler is damaged and gives me the option to delete it. The platform independent version of CayenneModeler 3.2M1 works fine with jdk1.7.0_45.

      I can confirm that installing java 6 from Apple solved the problem.

      To prevent Java 6 from wanting to install, I had edited /Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Info.plist

      and replaced

      <key>JVMCapabilities</key>
      <array>
      <string>CommandLine</string>
      </array>

      with the following:

      <key>JVMCapabilities</key>
      <array>
      <string>JNI</string>
      <string>BundledApp</string>
      <string>WebStart</string>
      <string>Applets</string>
      <string>CommandLine</string>
      </array>

        Activity

        Hide
        Andrus Adamchik added a comment -

        I think we'll be able to fix that with relatively little pain. Oracle OS X java preserved "com.apple.eawt" package. So I downloaded Appbundler [1], created a small change in the Mac assembly [2], and assembled Modeler with the following Ant script [3]. This produced clickable app that starts with expected OS X look-and-feel and is otherwise indistinguishable from Java 6 OS X modeler. I guess now we need to integrate this into the build process.

        BTW, with " <runtime dir="$

        {env.JAVA_HOME}" />" option we can include Java 7 runtime in the app... too bad the size of the app goes up from ~8 to 148 MB (56MB when gzipped). So I guess we'll rely on users installing their own JRE.

        [1] https://java.net/projects/appbundler/pages/Home
        [2] diff --git a/modeler/cayenne-modeler-mac/pom.xml b/modeler/cayenne-modeler-mac/pom.xml
        index d807151..40662e5 100644
        — a/modeler/cayenne-modeler-mac/pom.xml
        +++ b/modeler/cayenne-modeler-mac/pom.xml
        @@ -85,9 +85,8 @@
        <longName>${project.version}</longName>
        <destDir>target/modeler</destDir>
        <mainClass>org.apache.cayenne.modeler.osx.OSXMain</mainClass>
        - <icon>src/japplication/resources/CayenneModeler.icns</icon>
        - <os>mac</os>
        - <jvm>1.5+</jvm>
        + <os>java</os>
        + <jvm>1.7+</jvm>
        <jvmOptions>-Xmx500m</jvmOptions>
        </configuration>
        <executions>

        [3] <project name="CayenneModelerBundler">
        <taskdef
        name="bundleapp"
        classname="com.oracle.appbundler.AppBundlerTask"
        classpath="lib/appbundler-1.0.jar" />
        <property environment="env" />
        <target name="bundle">
        <bundleapp
        outputdirectory="dist"
        name="CayenneModeler"
        displayname="CayenneModeler"
        identifier="org.apache.cayenne"
        mainclassname="org.apache.cayenne.modeler.osx.OSXMain"
        icon="/Users/cayenne/work/cayenne/modeler/cayenne-modeler-mac/src/japplication/resources/CayenneModeler.icns">
        <runtime dir="${env.JAVA_HOME}

        " />
        <classpath file="/Users/cayenne/work/cayenne/modeler/cayenne-modeler-mac/target/modeler/CayenneModeler.jar" />
        <option value="-Dapple.laf.useScreenMenuBar=true"/>
        </bundleapp>
        </target>
        </project>

        Show
        Andrus Adamchik added a comment - I think we'll be able to fix that with relatively little pain. Oracle OS X java preserved "com.apple.eawt" package. So I downloaded Appbundler [1] , created a small change in the Mac assembly [2] , and assembled Modeler with the following Ant script [3] . This produced clickable app that starts with expected OS X look-and-feel and is otherwise indistinguishable from Java 6 OS X modeler. I guess now we need to integrate this into the build process. BTW, with " <runtime dir="$ {env.JAVA_HOME}" />" option we can include Java 7 runtime in the app... too bad the size of the app goes up from ~8 to 148 MB (56MB when gzipped). So I guess we'll rely on users installing their own JRE. [1] https://java.net/projects/appbundler/pages/Home [2] diff --git a/modeler/cayenne-modeler-mac/pom.xml b/modeler/cayenne-modeler-mac/pom.xml index d807151..40662e5 100644 — a/modeler/cayenne-modeler-mac/pom.xml +++ b/modeler/cayenne-modeler-mac/pom.xml @@ -85,9 +85,8 @@ <longName>${project.version}</longName> <destDir>target/modeler</destDir> <mainClass>org.apache.cayenne.modeler.osx.OSXMain</mainClass> - <icon>src/japplication/resources/CayenneModeler.icns</icon> - <os>mac</os> - <jvm>1.5+</jvm> + <os>java</os> + <jvm>1.7+</jvm> <jvmOptions>-Xmx500m</jvmOptions> </configuration> <executions> [3] <project name="CayenneModelerBundler"> <taskdef name="bundleapp" classname="com.oracle.appbundler.AppBundlerTask" classpath="lib/appbundler-1.0.jar" /> <property environment="env" /> <target name="bundle"> <bundleapp outputdirectory="dist" name="CayenneModeler" displayname="CayenneModeler" identifier="org.apache.cayenne" mainclassname="org.apache.cayenne.modeler.osx.OSXMain" icon="/Users/cayenne/work/cayenne/modeler/cayenne-modeler-mac/src/japplication/resources/CayenneModeler.icns"> <runtime dir="${env.JAVA_HOME} " /> <classpath file="/Users/cayenne/work/cayenne/modeler/cayenne-modeler-mac/target/modeler/CayenneModeler.jar" /> <option value="-Dapple.laf.useScreenMenuBar=true"/> </bundleapp> </target> </project>
        Hide
        Andrus Adamchik added a comment -

        I started on this by forking our japplication plugin on Github, so that we could further develop it, and maybe add support for appbundler. Still working on it here: https://github.com/andrus/japp-maven-plugin

        Show
        Andrus Adamchik added a comment - I started on this by forking our japplication plugin on Github, so that we could further develop it, and maybe add support for appbundler. Still working on it here: https://github.com/andrus/japp-maven-plugin
        Hide
        Andrus Adamchik added a comment -
        Show
        Andrus Adamchik added a comment - japp-maven plugin v. 3.0 is released - https://github.com/andrus/japp-maven-plugin I fixed trunk per r1546735 - the assembly now provides both 1.7 CM and a "legacy" 1.6 CM

          People

          • Assignee:
            Unassigned
            Reporter:
            D Tim Cummings
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development