Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: failed parameter passing to main?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: failed parameter passing to main?



The initial problem:
>> I've got an application I normally launch with the following arguments
>> java -Xmx256m
>> -classpath "/myhome/Desktop/ice_junk/contigeditor.jar:/myhome/Desktop/
>> ice_junk/mysql.jar" contigeditor.ContigEditorApplet
>> "http://an.ip.address/ice/"; "another.ip.address" "mouse"
>>
>> I've tried to use the MRJ App builder to make this nice and
>> double-clickable. The program launches, but then shows a dialog
>> indicating
>> that it's getting the wrong number of parameters.

> You should also post what is in your MRJApp.properties file for us to
> figure out what is wrong.
>
> You can also try launching your app from the command line in Terminal
> with verbose launching. You need use the full path to the executable
> inside the .app package. Ex:
>
> prompt> setenv JAVA_LAUNCHER_VERBOSE
> prompt> /path/MyApp.app/Contents/MacOS/MyApp
>
> The launcher will then print out status information as it parses your
> MRJApp.properties file.

I've tried this two ways now: one with a "terse" form, where the class
paths and main() location were omitted from the passed parameters (since
they seem to be handled by the wrapper) and a verbose one where everything
is identical to the args above. For the verbose one, I should note that
I've also kept the original .jar files in the locations pointed to by those
args.

Some further details which may or may not be helpful - I'm not the original
author of this software; it's freely downloadable, and I'm just trying to
make it so that people in my lab don't have to fuss to much to get it to
run. The downside is that I can't tell you what exactly it is that main()
is looking for. Depending on which version of the args I use, the dialog
shows a different numbered error (the dialog is displayed by the java app,
so it at least finishes launching).

I've also tried launching this through Obj-C/NSTask and Java/Process, but
neither of those seem to handle the parameter list well, either.

Thanks,
Jay

details:
////////////////////////////////////////////////////////////////////////////
The terse property list is:
# This file is loaded by the Java Virtual Machine on MacOS.
# Most
information herein is loaded into the JVM System properties upon launch.
#
The '#' character denotes a comment that occupies the rest of the line.
#
Each property should occupy a single line. For
example:
#com.apple.mrj.application.classpath=MyApplication.jar
#com.apple.m
rj.application.main=MyMainClass

com.apple.mrj.application.gc.async=true
com
.apple.mrj.application.stderr=$SYSTEM
com.apple.mrj.application.classpath=Co
ntents/Resources/Java/contigeditor.jar:Contents/Resources/Java/mysql.jar:
co
m.apple.mrj.application.stderr.append=false
com.apple.mrj.application.stdout
.append=false
com.apple.mrj.application.stdin=/dev/null
com.apple.mrj.applic
ation.verify=remote
com.apple.mrj.application.classloading.verbose=false
com
.apple.mrj.application.gc.min=2M
com.apple.mrj.application.stdout.unicode=fa
lse
com.apple.mrj.application.stderr.unicode=false
com.apple.mrj.application
.gc.max=64M
com.apple.mrj.application.stdout=$SYSTEM
com.apple.mrj.applicati
on.stderr.file.creator=CWIE
com.apple.mrj.application.build.version=1.0
com.
apple.mrj.application.main=contigeditor.ContigEditorApplet
com.apple.mrj.app
lication.jitc.disable=false
com.apple.mrj.application.parameters=-Xmx256m
"http://icebox.bcgsc.ca/ice/"; "142.103.205.4"
"mouse"
com.apple.mrj.application.profiling=false
com.apple.mrj.application.
stdout.file.creator=CWIE
com.apple.mrj.application.growbox.intrudes=false


/////////////////////////////////////////////////////////////////////////
and the output is:
[localhost:mouse-terse.app/Contents/MacOS] drjay%
/Users/drjay/Desktop/ice_junk/mouse-terse.app/Contents/MacOS/JavaApplication
Stub
[JavaAppLauncher] reading properties from:
/Users/drjay/Desktop/ice_junk/mouse-terse.app/Contents/Resources/MRJApp.prop
erties
[JavaAppLauncher] original classpath:
Contents/Resources/Java/contigeditor.jar:Contents/Resources/Java/mysql.jar:
[JavaAppLauncher] fixed up classpath:
/Users/drjay/Desktop/ice_junk/mouse-terse.app/Contents/Resources/Java/contig
editor.jar:/Users/drjay/Desktop/ice_junk/mouse-terse.app/Contents/Resources/
Java/mysql.jar:
[JavaAppLauncher] VM option:
-Djava.class.path=/Users/drjay/Desktop/ice_junk/mouse-terse.app/Contents/Res
ources/Java/contigeditor.jar:/Users/drjay/Desktop/ice_junk/mouse-terse.app/C
ontents/Resources/Java/mysql.jar:
[JavaAppLauncher] VM option: -Dcom.apple.mrj.application.gc.async=true
[JavaAppLauncher] VM option: -Dcom.apple.mrj.application.stderr=$SYSTEM
[JavaAppLauncher] VM option:
-Dcom.apple.mrj.application.classpath=Contents/Resources/Java/contigeditor.j
ar:Contents/Resources/Java/mysql.jar:
[JavaAppLauncher] VM option: -Dcom.apple.mrj.application.stderr.append=false
[JavaAppLauncher] VM option: -Dcom.apple.mrj.application.stdout.append=false
[JavaAppLauncher] VM option: -Dcom.apple.mrj.application.stdin=/dev/null
[JavaAppLauncher] VM option: -Dcom.apple.mrj.application.verify=remote
[JavaAppLauncher] VM option:
-Dcom.apple.mrj.application.classloading.verbose=false
[JavaAppLauncher] VM option: -Dcom.apple.mrj.application.gc.min=2M
[JavaAppLauncher] VM option:
-Dcom.apple.mrj.application.stdout.unicode=false
[JavaAppLauncher] VM option:
-Dcom.apple.mrj.application.stderr.unicode=false
[JavaAppLauncher] VM option: -Dcom.apple.mrj.application.gc.max=64M
[JavaAppLauncher] VM option: -Dcom.apple.mrj.application.stdout=$SYSTEM
[JavaAppLauncher] VM option:
-Dcom.apple.mrj.application.stderr.file.creator=CWIE
[JavaAppLauncher] VM option: -Dcom.apple.mrj.application.build.version=1.0
[JavaAppLauncher] VM option:
-Dcom.apple.mrj.application.main=contigeditor.ContigEditorApplet
[JavaAppLauncher] VM option: -Dcom.apple.mrj.application.jitc.disable=false
[JavaAppLauncher] VM option: -Dcom.apple.mrj.application.parameters=-Xmx256m
"http://icebox.bcgsc.ca/ice/"; "142.103.205.4" "mouse"
[JavaAppLauncher] VM option: -Dcom.apple.mrj.application.profiling=false
[JavaAppLauncher] VM option:
-Dcom.apple.mrj.application.stdout.file.creator=CWIE
[JavaAppLauncher] VM option:
-Dcom.apple.mrj.application.growbox.intrudes=false
[JavaAppLauncher] Loading app class com/apple/buckyball/app/CarbonLibApp...
[JavaAppLauncher] Launching Java app shell...
UIManager.getCrossPlatformLookAndFeelClassName() =
javax.swing.plaf.metal.MetalLookAndFeel
[localhost:mouse-terse.app/Contents/MacOS] drjay%



/////////////////////////////////////////////////////////////////////////
the verbose property list is:
# This file is loaded by the Java Virtual Machine on MacOS.
# Most
information herein is loaded into the JVM System properties upon launch.
#
The '#' character denotes a comment that occupies the rest of the line.
#
Each property should occupy a single line. For
example:
#com.apple.mrj.application.classpath=MyApplication.jar
#com.apple.m
rj.application.main=MyMainClass

com.apple.mrj.application.gc.async=true
com
.apple.mrj.application.stderr=$SYSTEM
com.apple.mrj.application.classpath=Co
ntents/Resources/Java/contigeditor.jar:Contents/Resources/Java/mysql.jar:
co
m.apple.mrj.application.stderr.append=false
com.apple.mrj.application.stdout
.append=false
com.apple.mrj.application.stdin=/dev/null
com.apple.mrj.applic
ation.verify=remote
com.apple.mrj.application.classloading.verbose=false
com
.apple.mrj.application.gc.min=2M
com.apple.mrj.application.stdout.unicode=fa
lse
com.apple.mrj.application.stderr.unicode=false
com.apple.mrj.application
.gc.max=64M
com.apple.mrj.application.stdout=$SYSTEM
com.apple.mrj.applicati
on.stderr.file.creator=CWIE
com.apple.mrj.application.build.version=1.0
com.
apple.mrj.application.main=contigeditor.ContigEditorApplet
com.apple.mrj.app
lication.jitc.disable=false
com.apple.mrj.application.parameters=-Xmx256m
-classpath
"/Users/drjay/Desktop/ice_junk/contigeditor.jar:/Users/drjay/Desktop/ice_jun
k/mysql.jar" contigeditor.ContigEditorApplet "http://icebox.bcgsc.ca/ice/";
"142.103.205.4"
"mouse"
com.apple.mrj.application.profiling=false
com.apple.mrj.application.
stdout.file.creator=CWIE
com.apple.mrj.application.growbox.intrudes=false


/////////////////////////////////////////////////////////////////////////
and the output is:
[JavaAppLauncher] reading properties from:
/Users/drjay/Desktop/ice_junk/mouse-verbose.app/Contents/Resources/MRJApp.pr
operties
[JavaAppLauncher] original classpath:
Contents/Resources/Java/contigeditor.jar:Contents/Resources/Java/mysql.jar:
[JavaAppLauncher] fixed up classpath:
/Users/drjay/Desktop/ice_junk/mouse-verbose.app/Contents/Resources/Java/cont
igeditor.jar:/Users/drjay/Desktop/ice_junk/mouse-verbose.app/Contents/Resour
ces/Java/mysql.jar:
[JavaAppLauncher] VM option:
-Djava.class.path=/Users/drjay/Desktop/ice_junk/mouse-verbose.app/Contents/R
esources/Java/contigeditor.jar:/Users/drjay/Desktop/ice_junk/mouse-verbose.a
pp/Contents/Resources/Java/mysql.jar:
[JavaAppLauncher] VM option: -Dcom.apple.mrj.application.gc.async=true
[JavaAppLauncher] VM option: -Dcom.apple.mrj.application.stderr=$SYSTEM
[JavaAppLauncher] VM option:
-Dcom.apple.mrj.application.classpath=Contents/Resources/Java/contigeditor.j
ar:Contents/Resources/Java/mysql.jar:
[JavaAppLauncher] VM option: -Dcom.apple.mrj.application.stderr.append=false
[JavaAppLauncher] VM option: -Dcom.apple.mrj.application.stdout.append=false
[JavaAppLauncher] VM option: -Dcom.apple.mrj.application.stdin=/dev/null
[JavaAppLauncher] VM option: -Dcom.apple.mrj.application.verify=remote
[JavaAppLauncher] VM option:
-Dcom.apple.mrj.application.classloading.verbose=false
[JavaAppLauncher] VM option: -Dcom.apple.mrj.application.gc.min=2M
[JavaAppLauncher] VM option:
-Dcom.apple.mrj.application.stdout.unicode=false
[JavaAppLauncher] VM option:
-Dcom.apple.mrj.application.stderr.unicode=false
[JavaAppLauncher] VM option: -Dcom.apple.mrj.application.gc.max=64M
[JavaAppLauncher] VM option: -Dcom.apple.mrj.application.stdout=$SYSTEM
[JavaAppLauncher] VM option:
-Dcom.apple.mrj.application.stderr.file.creator=CWIE
[JavaAppLauncher] VM option: -Dcom.apple.mrj.application.build.version=1.0
[JavaAppLauncher] VM option:
-Dcom.apple.mrj.application.main=contigeditor.ContigEditorApplet
[JavaAppLauncher] VM option: -Dcom.apple.mrj.application.jitc.disable=false
[JavaAppLauncher] VM option: -Dcom.apple.mrj.application.parameters=-Xmx256m
-classpath
"/Users/drjay/Desktop/ice_junk/contigeditor.jar:/Users/drjay/Desktop/ice_jun
k/mysql.jar" contigeditor.ContigEditorApplet "http://icebox.bcgsc.ca/ice/";
"142.103.205.4" "mouse"
[JavaAppLauncher] VM option: -Dcom.apple.mrj.application.profiling=false
[JavaAppLauncher] VM option:
-Dcom.apple.mrj.application.stdout.file.creator=CWIE
[JavaAppLauncher] VM option:
-Dcom.apple.mrj.application.growbox.intrudes=false
[JavaAppLauncher] Loading app class com/apple/buckyball/app/CarbonLibApp...
[JavaAppLauncher] Launching Java app shell...
UIManager.getCrossPlatformLookAndFeelClassName() =
javax.swing.plaf.metal.MetalLookAndFeel
[localhost:mouse-terse.app/Contents/MacOS] drjay%


References: 
 >Re: failed parameter passing to main? (From: Nick Kledzik <email@hidden>)



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

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.