Sun Studio 12 - Can't specify command line args while profiling

New to Sun Studio development environment, and having trouble profiling my application. I have specified command-line arguments for both Debug and Release builds in Project/Configuration Properties/Runninjg/Arguments and this works fine when running the project from within the IDE. However when I attempt to profile the application through IDE Advanced/Advanced Profiling/Start, my application is launched with no command line arguments. So far I have been unable to find any place to define command line arguments for the program when run using the profiler. Any insights would be greatly appreciated.
Regards,
Chad.

Yes, there is a bug. I reproduced the problem using a sample project Welcome. If I run it without profiling, the program prints correct arguments:
Welcome ...
Arguments:
1: arg 1
2: arg 2
[Press Enter to close window] If I run it with profiling "Advanced->Advanced Profiling->Start", the program prints wrong arguments:
Running "/export/home/SunStudio/SUNWspro/prod/bin/collect  -d /export/home/nikm/SunStudioProjects/Welcome/nbproject/private/experiments -o test.1.er -A on   -p on  -S on  /export/home/nikm/SunStudioProjects/Welcome/dist/Debug/welcome arg 1 arg 2" in /export/home/nikm/SunStudioProjects/Welcome
Creating experiment database /export/home/nikm/SunStudioProjects/Welcome/nbproject/private/experiments/test.1.er ...
Welcome ...
Arguments:
1: arg
2: 1
3: arg
4: 2
5: null
Run successful. Exit value 0.Note, it got 5 arguments instead of 2.
So, there are two bugs:
1. argument with spaces is transformed to several arguments.
2. a "null" argument is added to the list.
I'll file this bug and let you know the number.
A workaround is to ignore the last argument in your
program if it is "null", but this is a very ugly workaround :-)
Thanks,
Nik

Similar Messages

  • Include command line args in executable jar?

    Hello all,
    I'm trying to package up some software which takes 2 command line args to run (for example, java -jar prog.jar FooBar 3.14159). I'm using a utility called Jar2Exe to wrap it up into an exe (still needs JRE to run, but it's nicer packaging for distribution).
    My question is, how can I included command line arguments in the jar? Or can I? Or, are there any exe-wrapping utilities out there that will allow me to accomplish this?
    Thanks,
    -Thok

    Thok wrote:
    Hello all,
    I'm trying to package up some software which takes 2 command line args to run (for example, java -jar prog.jar FooBar 3.14159). I'm using a utility called Jar2Exe to wrap it up into an exe (still needs JRE to run, but it's nicer packaging for distribution).
    My question is, how can I included command line arguments in the jar? Or can I? Or, are there any exe-wrapping utilities out there that will allow me to accomplish this?
    Thanks,
    -ThokOkay, did some more research... It appears you can't specify command line options in a jar, but if you package it into an exe, you can--depending on what utility you use to wrap it, that is. I downloaded a free one (Launch4j) and it does the trick.
    -Thok

  • How can hide the command line of a t.code in the portal

    Dear Experts.
    I have the following doubt:
    How can hide the Command Line of a Report that is called with a T.Code in the portal?
    Attach Image:
    [Image T.Code|http://www.freeimagehosting.net/uploads/eab3b6a03c.jpg]
    When I created a service using the T.Code SICF for the T.Code , I can hide buttons and the filed command line  using
    ~webgui_simple_toolbar
    ~singletransaction
    ~NOHEADEROKCODE
    With notes 1010519, "SAP GUI for HTML: Simplified Title Area Without Menu and OK Code" and 959417.
    But the problem is that when I create the service in the T.Code SICF, I also have that create an Iview IAC in the portal.
    The Question is : How can hide this fields and buttons if I want Publish the T.code using an Iview Transaction in the portal?
    In this moment I have used the two options:
    1 option) I created a service using the t.Code SICF for my Transaction and I also created an Iview IAC in the portal for call the service.
    RESULT:
    SAP Web Application Server
             500 Connection timed out
            Error: -5
           Version: 7000
           Component: ICM
           Date/Time: Sat Jun 12 20:26:39 2010 
           Module: icxxthr_mt.c
           Line: 2698
           Server: xyxab...
    Error Tag: {-}
    Detail: Connection to partner timed out after 60s
    2)  created an Iview Transaction  in the portal and  call my transaction.
    RESULT.
    [Image T.Code|http://www.freeimagehosting.net/uploads/eab3b6a03c.jpg]
    But not can hide the field Command Line and other buttons.
    I think that the command :
    ~webgui_simple_toolbar
    ~singletransaction
    ~NOHEADEROKCODE
    Only can be used if I create a service using the T.Code SICF .
    Best Regards
    Carmen.

    Hi Carmen,
    The bottom line is that this cannot be done for transaction iviews without modifying the standard webgui service in SICF, which is probably not a good idea (since it affects everyone using SAP GUI for HTML). (You could hack the appintegrator to add the ~webgui_simple_toolbar parameter to the transaction URL template in the portal, but again its not a recommended thing to do ...). Better to create an IAC service in SICF with ~webgui=1 where you set the required appearance using an appropriate value for ~webgui_simple_toolbar, and then create an IAC iview to point at this service.
    You can even override the ~transaction value configured in the new service in individual IAC iviews by entering the appropriate value in the application parameter of the iview, for example:
    ~okcode=/nSU01
    And you can pass parameters in the same way:
    ~okcode=/nSU01 USR02-BNAME=xyz;USREFUS-USERALIAS=abc;
    By the way, it would not be recommended to create a URL iview to access an IAC, since you are likely to encounter session management issues in this scenario - better to use an IAC iview.
    Regards, Rory

  • Wrong to process command line args in a loop?

    I tried to process my command line args like this:
    int[] rgb = {0,0,0};
              for(int i=1;i<3;i++)
                   rgb[i-1] = Integer.parseInt(args);
    I enter six args where args 1 to 3 are ints and not zero, but rgb[2] always ends up being zero. I had to do away with the loop and write out three assignment statements, but if I had ten or more args that would be a headache! Does anyone know why this is happening? I'm using JDK 1.3.1_15.

    for(int i=0;i<3;i++)
       rgb[i] = Integer.parseInt(args);
    Look closely and make sure you understand the differences between my code and yours:
    * i starts at 0, not 1
    * rgb uses i for index, not i - 1.
    Why would you have rgb using i -1 and args using i?
    Now, if you have an arg [i]before the RGB args, then it would make sense for args' index to be different than rgb's. In that case, you might have i-1 and i, or i and i+1, etc. depending on how you structure your loop.
    The main problem is that you had i=1; i<3, which will go through the loop body for i=1 and i=2 only. Make sure you understand why.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Command line args

    I have this program and I need to use command line args which
    will print ell . this program does this but I am using
    substring instead of command line args.
    public class h11 {
    public static void main (String [] args ) {
    String greeting = "Hello";
    String h11 = greeting . substring (1, 4);
    System.out.println( h11);
    output: ell
    Anyone..

    First off, the index of characters in a String is 0 based so in the string "Hello" you have the following;
    char 0 = "H"
    char 1 = "e"
    char 2 = "l"
    char 3 = "l"
    char 4 = "o"
    String.substring(start, end) is first inclusive and last exclusive so the parameters (1, 4) would return characters 1, 2 & 3 but not 0 or 4.
    To get the whole word Hello (not withstanding that that's the entire string) you would want greeting.substring(0,5) however that would generate an index out of bounds error because 5 isn't a valid index for that string. So, here's a small sample program to show how to do what I think you're after.
    public class ParmsTest{
         public static void main(String[] args){
              if( args.length > 0 ){
                   String parm = null ;
                   int end = 0 ;
                   int start = 0 ;
                   for( int i=0; i< args.length; i++ ){
                        parm = args[i] ;
                        if( parm.length() > 4 ){
                             end = 4;
                        else{
                             end = parm.length() - 1 ;
                        if( end > start ){
                             System.out.println( parm.substring(start, end) ) ;
                        else{
                             System.out.println( "Nothing to get" ) ;
              System.out.println( "Finished processing parameters" ) ;
    }It's a bit more complicated than your sample, but it also checks to see if there were any parameters, and it checks to see if the length we're trying to get is valid. Lastly it checks to see if there was anything to get before trying to print it. If it doesn't find anything to print it prints a message saying so.
    Here's the question I have for you. Why? Why did I go to this trouble?

  • How can I make command line interface (CLI)

    Hi All,
    How can I make command line interface ( CLI ) In Java using JTextArea or JTextField.
    Thanks In advance..
    Vikas Sahu

    We do agree with your assessment and have plans to improve all of these aspects. Unfortunately, it takes a long time and a lot of work to turn "working" software into "simple to use" software, but we are working on it, and it is a high priority for us to make it simpler to use and develop for and administer Coherence.
    Peace,
    Cameron Purdy | Oracle Coherence

  • Bash number of command line args....

    Hi,
    Is there a way in bash to get number of command line args ...
    atm I am using $1 but of course if you pass a command like uname -a you need two?
    wondered if there is a $<foo> that ill give number of args passed?
    EDIT looks like '$#' emmmm lets see....

    woah!!! ok thanks ..... $# gives me number of args ... will check it out
    $1 $2 > /tmp/cmd
    messy way.....

  • About Command line args

    there is command line argument fir integer like Integer.parseInt(args[0]); can we write same for "char" and" double" also like "Double.parseDouble" or else......

    this has nothing to do with command line arguments
    but yes, all the primitive wrapper classes can parse back their primitive
    Learn to use the API, it's your friend
    http://java.sun.com/javase/6/docs/api/

  • Passing command line args

    I'm a beginner in java and I need to know now to write the code that takes in a randon number of numbers at the command line and stores them in an array
    ie. the program is called number and when I run it, it has to take in the numbers at the command line
    ie. java numbers 12 13 14 15 19 1
    then these numbers are to be stored in an array
    How can I do this??
    Thanking you
    Tom

    public class Numbers {
        public static void main(String[] args) {
            // Convert to integers
            int[] param = new int[args.length];
            for ( int cnt = 0; cnt < args.length; cnt++ ) {
                try {
                    param[cnt] = Integer.parseInt(args[cnt]);
                } catch (NumberFormatException nfe) {
                    System.err.println("Argument " + cnt + " is not integer, using '-1'");
                    param[cnt] = -1;
            // use integers ...
    }

  • IEAK IE9 msi - Can not find command line to make install process passive with a reboot prompt

    hey all, this seems to be something simple and I can not get it to work the way intended.   I want IE9 installer to install passively and then prompt for reboot, that's it.  
    I have tried using the switches for the standard exe from Microsoft but nothing allows for passive and prompt for reboot
    I have now also downloaded and used IEAK and then created msi installs and selected the passive and prompt for reboot options which does not make the installer do that actual behavior by default.  
    So I have now actually began trying various commands with the IEAK msi files, none of which are making the behavior I desire happen, passive with prompt for reboot.
    Can anyone suggest a proper command line for this?
    I have essentially tried these on the different installers I have built, and sometimes entered the /passive on full installers:
    msiexec.exe filename /promptrestart
    msiexec.exe filename REBOOTPROMPT=""

    Hi,
    I am afraid when using /passive options together, there would be no promote when installing.
    See the instruction for /passive here:
    The installer displays a progress bar to the user that indicates that an installation is in progress but no prompts or error messages are displayed to the user. The user cannot cancel the installation. Use the
    /norestart or /forcerestart standard command-line options to control reboots.
    If no reboot option is specified, the installer restarts the computer whenever necessary
    without displaying any prompt or warning to the user.
    Based on my unserstanding, when using this command option, we can only choose restart or not with the
    /norestart or /forcerestart standard command-line options
    If /passive is in use, then the promote would be expected not to work. So if we would like to force install IE, then we might better schedule the install time or restart out of the work hours.
    Best regards
    Michael Shao
    TechNet Community Support

  • Reading directory path as command line args

    Hello,
    I'm trying to write a simple java web server that serves files from a specified directory over a specified port no. (both specified at the command line).
    I am just wondering if any one has any advice on how to handle the directory argument and how check that it is valid etc.
    Thanks
    Gary

    Take a look at the File class, and the method isDirectory, and exists.
    Kaj

  • Environmental variables as command line args

    Hello, all,
    I would like to pass an environmental variable as a command line argument for a java program.
    Example:
    java MyClass $MY_VARIABLE
    However, it actually passes "$MY_VARIABLE", and not the value of MY_VARIABLE. I know that I can use java -D(MY_VARIABLE=SOMETHING) and get it using System.getProperty ("MY_VARIABLE");
    However, I would prefer it the first way, actually passing the variable inside command line. Is there a way to do this?
    Thank you,
    Elana

    Nevermind... Error in my code... It works
    Thank you

  • Wireless 1130 AP can't use command line

    I am unable to type anything in the command line of this AP. It has the latest IOS image installed. I can see the output of the bootup process and it loads the IOS image and brings up interfaces and whatnot but it doesn't go to the command line. I have attempted to turn this AP into autonomous mode and feel that I was successful but am still unable to use the command line.
    Can someone please help me out?
    Thanks

    Hi,
    Yes make sure your console client terminal setting is same as below and then check.
    Bits per Second: select 9600 (or desired baud rate)
    Data Bits: select 8
    Parity: select None
    Stop Bits: select 1
    Flow Control: select none

  • Can you use command lines to copy files in UNIX to Oracle Apps

    Hi! We have installed the oracle apps 11.5.0 to a unix operating system. And we use ftps to upload the rtf and xml files to the unix server. Is there any command lines we can use to copy all the rft and xml files in the server to the real location of where the report files stored without going through the XML Publisher font end through the internet explorer? Thanks for your help!

    Hi,
    From what you have mentioned, I believe you are writing custom xml pub report
    1) Storing all your template and sample xml data file on Unix box by FTPing it. This step is not required as XML publisher picks template from XDO tables (where it is stored in CLOB), unless you are explicitly Coding to use templates from a fixed location like <CUST_TOP>/<xml_templates>
    2) As part of XML setup, you need to define the template and datasource using the front end. This causes the Template and XML data (sample) to be stored in XDO tables (as clobs). This step is basically required and unavaoidable.This step can be automated using FNDLOAD tool (not sure).
    Hope it helps somewhat.
    Neeraj

  • Command line args from java to C++

    Hi
    I want to pass command line arguemnts argc and argv from java to C++. I have browsed the net and most of them suggested that I declare the jni statement with jObjectarray.
    I saw an example at http://www.csc.calpoly.edu/~fouzi/crossroads/Arguments.c
    It said
    #include "/home/java/linux/jdk118/include/jni.h"
    #include "Arguments.h"
    #include <stdio.h>
    JNIEXPORT void JNICALL
    Java_Arguments_setArgs (JNIEnv *jenv, jobject job, jobjectArray oarr)
    /* obtain the size the the array with a call to the JNI function
    GetArrayLength()                              */
    jsize argc = (*jenv)->GetArrayLength(jenv, oarr);
    /* Declare a char array for argv */
    char const* argv[128];
    int i;
    for (i = 1; i < argc + 1; i++) {
    /* obtain the current object from the object array */
    jobject myObject = (*jenv)->GetObjectArrayElement(jenv, oarr, i-1);
    /* Convert the object just obtained into a String */
    const char str = (jenv)->GetStringUTFChars(jenv,myObject,0);
    /* Build the argv array */
    argv[i] = str;
    /* print the argv array to the screen */
    printf ("argv[%i] = %s\n",i,argv);
    /* Free up memory to prevent memory leaks */
    (*jenv)->ReleaseStringUTFChars(jenv, myObject, str);
    // Increment argc to ajust the difference between Java and C arguments
    argc++;
    // Call a pipeline simulator function which uses command line arguments
    start(argc,argv);
    return;
    That is what I have where the start method is declared like this:
    void start(int argc, /* Argument count */ char argv[] / Argument strings */) {
    But I get a warning when I build the C routine. The warning arises when I am calling the start method.
    The warning says:
    f:\jni\dsaccess.c(711) : warning C4090: 'function' : different 'const' qualifiers
    f:\jni\dsaccess.c(711) : warning C4024: 'start' : different types for formal and actual parameter 2
    Can you help?
    Thanks
    Lakshmi

    1. Your array building looks bogus: Are you missing an index?
    2. You claim to be calling a "method". Are you? Or is it a subroutine?

Maybe you are looking for

  • Can i insert 'mozilla firefox start page' onto my toolbar instead of the standard google on the search box

    I'm having problems like a lot of others with Google as it has removed it's 'UK only' button from it's home/search screen. I prefer the Google Mozilla Firefox Start Page as it gives me the options I need. On the Firefox toolbar search box, which drop

  • Saving out .tiff to .jpeg using "Save As"

    Hi peoples, I hope you can help me with this saving out issue i have, If i open a .tiff from lightroom into photoshop cs6 with LR adjustments, I click "save as" .JPEG in a new location, I am now editing the .jpeg and not the tiff. Yet if I open the s

  • Color management screen/print & ICC Profiles

    Hi, I'm an amateur photographer and Lightroom 5 user. I shoot RAW with a Nikon D7000 and use Xrite Colorchecker passport to create camera profiles To calibrate my monitor I use Xrite i1 Display Pro (D65, 2.20 Gamma, 80 lumens brightness). I have had

  • Incompatibility with Photoshop CS2 ??

    I was running Photoshop CS2 two weeks ago, then last week it would crash every time. Has something in the OS  changed that would cause this?  I have repaired disk permissions and trashed the Prefs file.  Is there anything else I can do to prevent the

  • Message of failed load

    hi everybody! well, i got this code... and i'd like to personalize it more... 'cause it shows a message only if .css file fails... what about the .htm file, how can i do it? it could be better if someone knows the way the make a link in the "load fai