The following wrapper script (xyz) sets a few environment variables and starts the JVM software, but does not accept any command line options or a class name:
#!/bin/sh CLASSPATH=/mydir/myclass:/mydir/myjar.jar; export CLASSPATH ABC=/mydir/abc; export ABC java <options> myclass |
You could use such a script to debug a wrapper using dbx in one of two ways:
You could modify the script to start dbx from inside the wrapper script itself by adding the definition of the jvm_invocation variable to the script and starting dbx:
#!/bin/sh CLASSPATH=/mydir/myclass:/mydir/myjar.jar; export CLASSPATH ABC=/mydir/abc; export ABC jvm_invocation="java -Xdebug <options>"; export jvm_invocation dbx myclass.class |
Once you have made this modification, you could start the debugging session by running the script.
You could modify the script slightly to accept some command line options as follows:
#!/bin/sh CLASSPATH=/mydir/myclass:/mydir/myjar.jar; export CLASSPATH ABC=/mydir/abc; export ABC JAVA_OPTIONS="$1 <options>" java $JAVA_OPTIONS $2 |
Once you made this modification, you would set the jvm_invocation environment variable and start dbx as follows:
% jvm_invocation="xyz -Xdebug"; export jvm_invocation % dbx myclass.class |