Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Double clickable script question[Explanation of SOLUTION]



Dear Doug

Thank you for your assistance.

Have you tried something like:

    String cmdarray[] = {
        "java", "-jar",
        "<<path to App bundle>/Contents/.../MyJar.jar",
        "-client" };

Note that doing this will create the ugly effect of launching a
second application, with its own Dock icon, etc. Also, if the
app you launch via exec generates any output, you may need to
explicitly read the output and error streams to keep it from
deadlocking. This is not the preferred solution.

This also does not work, yet works just fine in a command shell. The error is again that it cannot instantiate the JVM which makes me think I'm missing something fundamental. Should I be including something I'm not? The error from XCode is:

Picked up _JAVA_OPTIONS: -Xdebug -Xnoagent -Xrunjdwp:transport=dt_local,server=y,address=8000
-[NSJavaVirtualMachine initWithClassPath:] cannot instantiate a Java virtual machine


This does not seem related to the Runtime.exec() call at all, since when I use:

	String cmdarray[] = new String[]{"open", "/Applications/Safari.app"};

I still get the same error:

Picked up _JAVA_OPTIONS: -Xdebug -Xnoagent -Xrunjdwp:transport=dt_local,server=y,address=8001
-[NSJavaVirtualMachine initWithClassPath:] cannot instantiate a Java virtual machine


my java app quits "unexpectedly" and yet Safari opens anyway!

A/Prof David Darby
Em email@hidden



_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden
References: 
 >Re: Double clickable script question[Explanation of SOLUTION] (From: Doug Zwick <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.