• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
[Cocoa-Java] HOWTO set Java VM arguments for Cocoa applications
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Cocoa-Java] HOWTO set Java VM arguments for Cocoa applications


  • Subject: [Cocoa-Java] HOWTO set Java VM arguments for Cocoa applications
  • From: OS X AIBO <email@hidden>
  • Date: Sat, 9 Nov 2002 15:48:25 -0800 (PST)

Forgive me if this is known, but I found very little information on
this so I'll assume this is both new and of interest to Cocoa-Java
folks.


=====================

As eluded to in the comments in NSJavaConfiguration.h, the Java virtual
machine arguments for a Cocoa application can be set on a
per-application basis from the command-line using the 'defaults'
command, i.e.:

Þfaults write YourAppNameHere JavaConfiguration '{ "JavaVMArguments"
= ("-verbose"); }'


NOTE: The value is an array of strings. A string value would cause an
app to crash with little information.


One can also set this for all Cocoa-Java applications with
Þfaults write JavaConfiguration '{ "JavaVMArguments" = ("-verbose");
}'

Presumably, one could also modify /System/Library/Java/JavaConfig.plist
directly.


=========================

Unless I missed something, the method for setting the JVM arguments for
a Cocoa application is totally obscure.

Cocoa-Java is unlike a pure-Java impl, so you cannot just run the VM
directly and pass in VM arguments with the command line.

The documentation from Apple that I was able to find is misleading.
Technote 2031 from Jun 12 2002
(http://developer.apple.com/technotes/tn/tn2031.html ) "Java Runtime
Properties for Mac OS X" completely ignores the Cocoa-Java case.

Lucky for me that I googled upon the existence of NSJavaConfiguration.h
(in the JavaVM.framework), read the comments therein, and was able to
deduce that the value of NSString *NSJavaVMArgumentsKey is literally
'JavaVMArguments', and that the value of this user default is an array
of strings.

Cheers,
Dan
U2 on LAUNCH - Exclusive greatest hits videos
http://launch.yahoo.com/u2
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: Calling a unix command from Cocoa ? (From: Thomas Castiglione <email@hidden>)

  • Prev by Date: TableColumn dataCell actions
  • Next by Date: Re: Calling a unix command from Cocoa ?
  • Previous by thread: Re: Calling a unix command from Cocoa ?
  • Next by thread: Re: Calling a unix command from Cocoa ?
  • Index(es):
    • Date
    • Thread