Hi Ahmed,
Thanks for the solution. I also tried the same thing and it worked for me. But 
there is some amount of inconsistency in the behavior which I would like to 
highlight here:
Is it possible that if double-quotes are NOT provided around the file name 
("C:\test.java") it will NOT work? OR is it that providing double-quotes around 
the file name is mandatory (even if the file name doesn't contain any blank 
spaces)
 
Because I have observed the following on 2 different machines running staf:
1. If you don't provide double-quotes it will throw a staf error. Also, it will 
work sometimes (in one of the machine I 
    saw it working without specifying the quotes)
2. Even with double-quotes provided it is not working on one other machine 
running staf.
 
My question is how is it possible that the same command works on one machine 
but doesn't work on the other running exactly same versions of staf.
 
Thanks & Regards
Subodh

________________________________

From: Ahmed Mostafa [mailto:[EMAIL PROTECTED]
Sent: Fri 9/5/2008 2:54 PM
To: Subodh Soni (WT01 - Computing and Storage IPG)
Cc: staf-users@lists.sourceforge.net
Subject: Re: [staf-users] Compiling java program through STAF


Hi Subodh, 


I tried your command, I had the following error only and I corrected it, and 
everything is OK.

test.java is not in the current path, so it is not found, this produced the 
following message in the shell where STAFProc is started:
javac: file not found: test.java
resolution is by changing the current directory where javac executes, by either:

*       changing the current directory to that location, OR 
*       executing staf local PROCESS Start Shell Command cd Parms "C:\some 
path" before executing your request, OR 
*       (preferred solution, for its generality) executing the command as: staf 
local PROCESS Start Shell Command javac Parms test.java WorkDir "C:\some path" 
Wait ReturnStdOut
        

Assuming you want to compile the file: C:\some path\ test.java

Hope this helps

2008/9/5 Subodh Soni <[EMAIL PROTECTED]>


        Hi,

        I am trying to compile a java program using STAF command as follows:

         

        C:\staf local process start shell command javac test.java wait 
returnstdout

         

        I get the following response from STAF:

         

        Response

        ---------------

        {

          Return Code: 1

          Key        : <None>

          Files      : [

            {

              Return Code: 0

              Data       :

            }

          ]

        }

        The above output means that my program is not compiled successfully. In 
addition, I verify that by checking if test.class is created in my current 
working directory, but it is not present.

         

        NOTE: Trying manually on the command prompt on Windows works fine i.e. 
if I give "javac test.java" it creates the test.class file without any issues, 
but through STAF, it does not seem to work.

         

        What am I doing wrong here? Please help me in this regard, as I cannot 
proceed further in my task without this basic thing working.

         

        Thanks & Regards

        Subodh


        
-------------------------------------------------------------------------
        This SF.Net email is sponsored by the Moblin Your Move Developer's 
challenge
        Build the coolest Linux based applications with Moblin SDK & win great 
prizes
        Grand prize is a trip for two to an Open Source event anywhere in the 
world
        http://moblin-contest.org/redirect.php?banner_id=100&url=/
        _______________________________________________
        staf-users mailing list
        staf-users@lists.sourceforge.net
        https://lists.sourceforge.net/lists/listinfo/staf-users
        
        




-- 
Ahmed Mostafa
Software Specialist
IBM Egypt, Cairo Technology Development Center 
0123919750
[EMAIL PROTECTED]

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users

Reply via email to