How to launch help pages from new-style Oracle Java OSX bundle structure? -
a few versions of java ago possible launch apple swing app bundling right, e.g. using jarbundler compile stub. i've switched using oracle's appbundler (actually infinitekind's fork) seems way app sharp on retina screens, , presumably way things going.
is there way bundle launchable pages using appbundler? (oracle's documentation doesn't mention anything).
or matter of putting pages in right place in bundle?
i should make clear i'm not using xcode , not plan to, although if there's one-time solution involving it, naturally will.
here's horrible hack found.
i have 3 ingredients:
- a recent version of infinitekind's appbundler fork allows
plistentrys. - a folder of html pages in folder called
onlinehelpin${resource.dir} - an old compiled helpbook launch stub called
libhelpbookjni.jnilibin${resource.dir}
where did launch stub come from? compiling this
#import <javavm/jni.h> #import <cocoa/cocoa.h> jniexport void jnicall java_edu_harvard_wcfia_yoshikoder_helpbook_launchhelpviewer (jnienv *env, jclass clazz) { [[nsapplication sharedapplication]] performselectoronmainthread:@selector(showhelp:) withobject:null waituntildone:no]; } which worked in java 1.6 days, , apparently still does. old ant task compiling looks this:
<target name="jni" description="compile jni bridge launches osx help"> <exec executable="cc"> <arg line="-c"/> <arg line="-i/system/library/frameworks/javavm.framework/headers"/> <arg line="-o helpbookjni.o"/> <arg value="src/objc/helpbookjni.m"/> </exec> <exec executable="cc"> <arg line="-dynamiclib"/> <arg line="-framework javavm"/> <arg line="-framework cocoa"/> <arg line="-o libhelpbookjni.jnilib"/> <arg value="helpbookjni.o"/> </exec> <delete file="helpbookjni.o" quiet="true"/> </target> with elderly , doubtless fragile library compiled, manually insert files in the relevant places in app bundle.
<bundleapp ...> ... <plistentry key="cfbundlehelpbookfolder" value="help"/> <plistentry key="cfbundlehelpbookname" value="yoshikoder help"/> </bundleapp> <copy todir="yoshikoder.app/contents/resources/help/"> <fileset dir="onlinehelp" includes="**/*" /> </copy> <copy file="${resource.dir}/libhelpbookjni.jnilib" todir="yoshikoder.app/contents/java/" /> if looks i'm making things go along, it's because i'm making things go along. work on mac running yosemite java 1.8 jdk (plus apple's own zombie java 1.6)
Comments
Post a Comment