Rgding java exec command

I am using the exec comnd to get 2 networking commnds' result but I am able to get only one. Here is the piece of code - any suggestion.
Thanks.
public class VariousNetwrkCommands {
Process Findspace;
public void ExecutePingCommand() throws IOException
String [] Command = {"ping"};
Findspace = Runtime.getRuntime().exec(Command);
BufferedReader Resultset = new BufferedReader(
new InputStreamReader (
Findspace.getInputStream()));
String line;
while ((line = Resultset.readLine()) != null) {
System.out.println(line);
Findspace.destroy();
public void ExecuteNetstatCommand() throws IOException
String [] Command = {"dir"};
Findspace = Runtime.getRuntime().exec(Command);
BufferedReader Resultset2 = new BufferedReader(
new InputStreamReader (
Findspace.getInputStream()));
String line2;
while ((line2 = Resultset2.readLine()) != null) {
System.out.println(line2);
Findspace.destroy();
}

ashum wrote:any suggestion.1) At least tell us which one works.
2) Read, digest and implement the recommendations in http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html .

Similar Messages

  • How can I run Runtime.exec command in Java To invoke several other javas?

    Dear Friends:
    I met a problem when I want to use a Java program to run other java processes by Runtime.exec command,
    How can I run Runtime.exec command in Java To invoke several other java processes??
    see code below,
    I want to use HelloHappyCall to call both HappyHoliday.java and HellowWorld.java,
    [1]. main program,
    package abc;
    import java.util.*;
    import java.io.*;
    class HelloHappyCall
         public static void main(String[] args){
              try
                   Runtime.getRuntime().exec("java  -version");
                   Runtime.getRuntime().exec("cmd /c java  HelloWorld "); // here start will create a new process..
                   System.out.println("Never mind abt the bach file execution...");
              catch(Exception ex)
                   System.out.println("Exception occured: " + ex);
    } [2]. sub 1 program
    package abc;
    import java.util.*;
    import java.io.*;
    class HelloWorld
         public static void main(String[] args){
         System.out.println("Hellow World");
    } [3]. Sub 2 program:
    package abc;
    import java.util.*;
    import java.io.*;
    class HappyHoliday
         public static void main(String[] args){
         System.out.println("Happy Holiday!!");
    } When I run, I got following:
    Never mind abt the bach file execution...
    I cannot see both Java version and Hellow World print, what is wrong??
    I use eclipse3.2
    Thanks a lot..

    sunnymanman wrote:
    Thanks,
    But How can I see both programs printout
    "Happy Holiday"
    and
    "Hello World"
    ??First of all, you're not even calling the Happy Holiday one. If you want it to do something, you have to invoke it.
    And by the way, in your comments, you mention that in one case, a new process is created. Actually, new processes are created each time you call Runtime.exec.
    Anyway, if you want the output from the processes, you read it using getInputStream from the Process class. In fact, you really should read that stream anyway (read that URL I sent you to find out why).
    If you want to print that output to the screen, then do so as you'd print anything to the screen.
    in notepad HelloWorld.java, I can see it is opened,
    but in Java, not.I have no idea what you're saying here. It's not relevant whether a source code file is opened in Notepad, when running a program.

  • Strange behaviour of Runtime.getRuntime().exec(command)

    hello guys,
    i wrote a program which executes some commands in commandline (actually tried multiple stuff.)
    what did i try?
    open "cmd.exe" manually (administrator)
    type "echo %PROCESSOR_ARCHITECTURE%" and hit enter, which returns me
    "AMD64"
    type "java -version" and hit enter, which returns me:
    "java version "1.6.0_10-beta"
    Java(TM) SE Runtime Environment (build 1.6.0_10-beta-b25)
    Java HotSpot(TM) 64-Bit Server VM (build 11.0-b12, mixed mode)"
    type "reg query "HKLM\SOFTWARE\7-zip"" returns me:
    HKEY_LOCAL_MACHINE\SOFTWARE\7-zip
    Path REG_SZ C:\Program Files\7-Zip\
    i wrote two functions to execute an command
    1) simply calls exec and reads errin and stdout from the process started:
    public static String execute(String command) {
              String result = "";
              try {
                   // Execute a command
                   Process child = Runtime.getRuntime().exec(command);
                   // Read from an input stream
                   InputStream in = child.getInputStream();
                   int c;
                   while ((c = in.read()) != -1) {
                        result += ((char) c);
                   in.close();
                   in = child.getErrorStream();
                   while ((c = in.read()) != -1) {
                        result += ((char) c);
                   in.close();
              } catch (IOException e) {
              return result;
         }the second function allows me to send multiple commands to the cmd
    public static String exec(String[] commands) {
              String line;
              String result = "";
              OutputStream stdin = null;
              InputStream stderr = null;
              InputStream stdout = null;
              // launch EXE and grab stdin/stdout and stderr
              try {
                   Process process;
                   process = Runtime.getRuntime().exec("cmd.exe");
                   stdin = process.getOutputStream();
                   stderr = process.getErrorStream();
                   stdout = process.getInputStream();
                   // "write" the parms into stdin
                   for (int i = 0; i < commands.length; i++) {
                        line = commands[i] + "\n";
                        stdin.write(line.getBytes());
                        stdin.flush();
                   stdin.close();
                   // clean up if any output in stdout
                   BufferedReader brCleanUp = new BufferedReader(
                             new InputStreamReader(stdout));
                   while ((line = brCleanUp.readLine()) != null) {
                        result += line + "\n";
                   brCleanUp.close();
                   // clean up if any output in stderr
                   brCleanUp = new BufferedReader(new InputStreamReader(stderr));
                   while ((line = brCleanUp.readLine()) != null) {
                        result += "ERR: " + line + "\n";
                   brCleanUp.close();
              } catch (IOException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
              return result;
         }so i try to execute the commands from above (yes, i am using \\ and \" in java)
    (1) "echo %PROCESSOR_ARCHITECTURE%"
    (2) "java -version"
    (3) "reg query "HKLM\SOFTWARE\7-zip""
    the first function returns me (note that ALL results are different from the stuff above!):
    (1) "" <-- empty ?!
    (2) java version "1.6.0_11"
    Java(TM) SE Runtime Environment (build 1.6.0_11-b03)
    Java HotSpot(TM) Client VM (build 11.0-b16, mixed mode, sharing)
    (3) ERROR: The system was unable to find the specified registry key or value.
    the second function returns me:
    (1) x86 <-- huh? i have AMD64
    (2) java version "1.6.0_11"
    Java(TM) SE Runtime Environment (build 1.6.0_11-b03)
    Java HotSpot(TM) Client VM (build 11.0-b16, mixed mode, sharing)
    (3) ERROR: The system was unable to find the specified registry key or value.
    horray! in this version the java version is correct! processor architecture is not empty but totally incorrect and the reg query is still err.
    any help is wellcome
    note: i only put stuff here, which returns me strange behaviour, most things are working correct with my functions (using the Runtime.getRuntime().exec(command); code)
    note2: "reg query "HKLM\HARDWARE\DESCRIPTION\System\CentralProcessor\0" /t REG_SZ" IS working, so why are "some" queries result in ERR, while they are working if typed by hand in cmd.exe?

    ok, i exported a jar file and execute it from cmd:
    java -jar myjar.jar
    now the output is:
    (1) "" if called by version 1, possible to retrieve by version 2 (no clue why!)
    (2) "java version "1.6.0_10-beta"
    Java(TM) SE Runtime Environment (build 1.6.0_10-beta-b25)
    Java HotSpot(TM) 64-Bit Server VM (build 11.0-b12, mixed mode)"
    (3) C:\Program Files\7-Zip\
    so all three problems are gone! (but its a hard way, as i need both functions and parse a lot of text... :/ )
    thanks for the tip, that eclipse changes variables (i really did not knew this one...)

  • Output of exec command

    Hi,
    I'm trying to compile java files at runtime and I want to see the execution output into my eclipse consol or anywhere. I've tried different thing such as
              Runtime r = Runtime.getRuntime();
              String command="";
              command = "javac -verbose" +
                        " c:/workspace/helloworld.java";
              Process p = r.exec(command);
              Runtime r = Runtime.getRuntime();
              String command="";
              command = "javac c:/workspace/helloworld.java > c:/file.txt";
              Process p = r.exec(command);
    But nothing seems to be output, I have no error/exception thrown in my eclipse console and the file isn't compile:\
    Any idea?
    Thanks

    try
    Runtime rt = Runtime.getRuntime();
    Process proc = rt.exec("javac");
    InputStream stderr = proc.getErrorStream();
    InputStreamReader isr = new InputStreamReader(stderr);
    BufferedReader br = new BufferedReader(isr);
    String line = null;
    System.out.println("<ERROR>");
    while ( (line = br.readLine()) != null)
    System.out.println(line);
    System.out.println("</ERROR>");
    int exitVal = proc.waitFor();
    System.out.println("Process exitValue: " + exitVal);
    } catch (Throwable t)
    t.printStackTrace();
    }

  • Java exec() child termination problem

    Hello,
    I am trying to use exec() to launch a java application from a Java Swing GUI. The problem is that If any of the applications call System.exit() or Runtime.exit(), all applications will terminate. How do I prevent the GUI from closing when the child closes? I have attached the code I am using for reference.
    Thanks in advance
      public void COmpileAndRun()
            String command = "javac Driver.java";
            try
                Runtime rt = Runtime.getRuntime(); //Process process = new ProcessBuilder(command).start();
                Process proc = rt.exec( command ); //Process process = new ProcessBuilder(command).start();
                InputStream stderr = proc.getErrorStream();
                InputStreamReader isr = new InputStreamReader(stderr);
                BufferedReader br = new BufferedReader(isr);
                String line = null;
                System.out.println("<ERROR>");
                while ( (line = br.readLine()) != null)
                    System.out.println(line);
                System.out.println("</ERROR>");
                int exitVal = proc.waitFor();
                System.out.println("Process exitValue: " + exitVal);
                if( exitVal == 0 )
                    command = "java Driver";
                    proc = rt.exec( command );
                    stderr = proc.getErrorStream();
                    isr = new InputStreamReader(stderr);
                    br = new BufferedReader(isr);
                    line = null;
                    System.out.println("<ERROR>");
                    while ( (line = br.readLine()) != null)
                        System.out.println(line);
                    System.out.println("</ERROR>");
                    exitVal = proc.waitFor();
                    System.out.println("Process exitValue: " + exitVal);
            } catch (Throwable t)
                t.printStackTrace();
    }

    String[] command =
       "java",
       "-cp",
       "my_class_path", // No extra quoting needed here
       "org.jetel.main.runGraph",
       "param1",
       "param2",
       "param3" // etc
    Process process = Runtime.getRuntime().exec(command);

  • Java exec question

    If i start a command with java exec and i want to terminate the command from running how to i do this?
    what i am doing now is i wait 5 seconds and if there is no output from the command i ask for exitValue() which throws an exception which i catch.
    This causes my main function to exit, but my two command output readers threads continue to read because the process is still alive.
    How do i kill the process? i tried to use destroy but its depreciated. Thanks in advance for the help.

    Tommaso wrote:
    I got my self so confused with depreciated methods like stop()Again, there is a significant difference between depreciated and deprecated.
    http://www.thefreedictionary.com/Depreciated
    http://www.thefreedictionary.com/Deprecated

  • How to add simple path in exec command??

    Hello friends...want some help on "How to add simple path in exec command?"Because on linux each time username changes I will have to change username in exec command.Please help me.
    My code for java on linux is
    Runtime r4=Runtime.getRuntime();
                                       Process p4=null;
         //     "oofromtemplate" is command name for openoffice on linux                    //my username on linux is "sandy"     
                                       try
                                       p4=r4.exec("oofromtemplate /home/sandy/complete/Output.html");
                                       catch(Exception ae)
                                       System.out.println("error");
                                       }

    System properties yield among other things:
    user.name       User's account name
    user.home      User's home directory
    user.dir      User's current working directory

  • Error in running rt.exec(command)

    Hey experts
    I don't understand the error that I got. My code is:
    openRTSPURL.addActionListener(new ActionListener(){
                   public void actionPerformed(ActionEvent e) {
                        String command = ("cmd/e/Client/java Client");
                        try{
                             Runtime rt = Runtime.getRuntime();
              Process process = rt.exec(command);
              } catch (IOException ex) {
                   System.out.println(ex);
                   System.exit(0);
                   }//end of catch
    OpenRTSPurl is the object name I created for a button which when I press the button it should run the command line.
    The error is:
    java.io.IOException: CreateProcess: cmd/e/Client/java Client error=2
    Anyone know why?
    Francis

    error=2 means it cant find the file, try adding a space
    'cmd /e /Client /java Client'....also why have you the slashes?

  • How to exec command with parameters through runtime.exec()

    im trying to run a command prompt passing in parameters. Right now im creating a .bat file like this
    c:
    cd C:\SOMEDIR
    ant deploy moreparameters
    and then passing in the file name into the exec command. It is running fine but im trying to use the runtime.destroy() command and it doesnt close the ant command, it only closes the bat file which was already closed. Is there a command I could pass into the exec() method to run the ant command with the parameters without using a bat file?

    im getting a CreateProcess: ant deploy -Dswasm=swasm error=2
    When i try to do
    cmds[0] = "ant";
    cmds[1] = "deploy";
    cmds[2] = "-Dswasm=all-bs";
    Process p = runTime.exec(cmds, null, new File("C:\\Program Files\\apache-ant-1.6.1\\bin"));
    its like it cant find ant. But it finds java command fine. What should i pass into the second parameter, it says "If envp is null, the subprocess inherits the environment settings of the current process. " Does that mean it will take the window system enviroment variables? if not what string would i pass in to set where ant is?

  • Adpatch: Error running SQL and EXEC commands in parallel

    Hi
    I am applying R12 RUP2 to an instance at the moment. I had an OS crash (I'm running R12 on Linux on VMWARE) and on reboot attempted to restart the patch.
    I now get an error as follows:
    Error running SQL and EXEC commands in parallel
    I must admit, I'm not a DBA, so if anyone has any ideas or has seen this before then it would be most appreciated!
    Thanks
    Chris

    Hi Adith
    The patch is 5484000, RUP 2 for E-Business Suite R12
    Here's the adpatch output:
    Start date: Wed Sep 12 2007 15:15:14
    0 "left over" javaupdates.txt files uploaded to DB: Wed Sep 12 2007 15:15:14
    0 patches uploaded from the ADPSV format patch history files: Wed Sep 12 2007 15:15:14
    Uploading information about files copied during the previous runs ...
    0 "left over" filescopied_<session_id>.txt files uploaded to DB: Wed Sep 12 2007 15:15:14
    ****************** E N D O F U P L O A D ******************
    End date: Wed Sep 12 2007 15:15:14
    Already asked for the name of the patch directory.
    (The answer was: /oracle/patches/5484000)
    Already asked for the name of the patch driver file.
    (The answer was: /oracle/patches/5484000/u5484000.drv)
    Reading release list save file...
    Done reading release list save file
    Log and Info File sync point:
    Wed Sep 12 2007 15:15:15
    Turning off actions that reference unrecognized products.
    Log and Info File sync point:
    Wed Sep 12 2007 15:15:15
    End of unrecognized products checking.
    (The number of parallel workers is: " 2 ")
    AutoPatch will run in parallel mode.
    Did not need to apply new applterr.txt.
    Skipping...
    Determine directories to create for Specified driver
    since no such action is present for this driver file
    Skipping...
    Determine Oracle Reports libraries to generate for Specified driver
    since no such action is present for this driver file
    Skipping...
    Determine if need to generate message files for Specified driver
    since no such action is present for this driver file
    Skipping...
    Create Directories for Specified driver
    since no such action is present for this driver file
    Number of invalid objects: 31057
    Running SQL scripts and EXEC commands...
    Determining which SQL and EXEC commands to run...
    Validating PL/SQL direct execute exceptions file ...
    Done validating PL/SQL direct execute exceptions file.
    SERVICE_NAME/INSTANCE_NAME : [VIS]
    connect_string : [(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ebusr12.chriseebee.me.uk)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=VIS)))]
    Done determining which SQL and EXEC commands to run.
    Running SQL and EXEC commands in parallel...
    Creating the AD_UTIL_PARAMS table...
    Table AD_UTIL_PARAMS already exists, so dropping the table and recreating it.
    Creating FND_INSTALL_PROCESSES table...
    Already created fnd_install_processes table
    Already created FND_INSTALL_PROCESSES_U1 index.
    Already created AD_DEFERRED_JOBS table
    Already created AD_DEFERRED_JOBS_U1 index.
    Writing dependencies of jobs to run to appldep.txt file...
    There are now 7569 jobs remaining (current phase=A0):
    0 running, 5 ready to run and 7564 waiting.
    Reading completed jobs from restart file (if any).
    There are now 3474 jobs remaining (current phase=A18):
    0 running, 1 ready to run and 3473 waiting.
    Determining which java executables are supported by adJavaWorker...
    Starting worker processes.
    Worker process 1 started.
    Worker process 2 started.
    Checking if all jobs have their actual and symbolic arguments in sync....
    Done.
    Writing jobs to run to restart file.
    Reading jobs from FND_INSTALL_PROCESSES table ...
    Running: file adobjcmp.sql on worker 1 for product ad username APPLSYS.
    AutoPatch error:
    The worker should not have status 'Running' or 'Restarted' at this point.
    Telling workers to quit...
    ************* Start of AD Worker session *************
    AD Worker version: 12.0.0
    AD Worker started at: Wed Sep 12 2007 15:15:34
    APPL_TOP is set to /oracle/VIS/apps/apps_st/appl
    ************* Start of AD Worker session *************
    AD Worker version: 12.0.0
    AD Worker started at: Wed Sep 12 2007 15:15:34
    APPL_TOP is set to /oracle/VIS/apps/apps_st/appl
    All workers have quit.
    AutoPatch error:
    Error running SQL and EXEC commands in parallel
    You should check the file
    /oracle/VIS/apps/apps_st/appl/admin/VIS/log/adpatch.log
    for errors.

  • Runtime.getRuntime().exec(command)

    I have to exec the keytool command from a server:
    MY CODE:
    String cmd = new String("/usr/local/j2sdkee/bin/keytool -genkey -dname \"cn="+nome+" "+cognome+", ou="+lavoro+", o="+impresa+", c="+stato+"\" -alias cert -keypass keypass -keystore /usr/local/server4/keystore/"+userid+" -storepass storepass -validity 180");               
    System.out.println("cmd = "+cmd);
    Runtime rt = java.lang.Runtime.getRuntime();
    Process ksGenerator = null;
    ksGenerator = rt.exec(cmd);
    ksGenerator.waitFor();
    System.out.println("exitValue "+ksGenerator.exitValue());
    PROBLEM:
    The exit Value is correct (=0) and there isn't any exception .... but the command didn't work...
    If i try to exec the command from shell it work.
    How can i do???
    THANKS

    Someone in another forum suggested that one should ALWAYS use the exec command that takes an array of arguments, rather than a single string.

  • Runtime.getRuntime().exec(Command) problems...

    hi, i am trying to run a NET USE command through using:
    Runtime.getRuntime().exec(Command);
    where Command is a valid NET USE command. I know it is valid because i executed this exact command
    from the command line and it worked fine. This class works perfectly under Windows, but then i took it to an
    OS/2 environment and i am getting this error. Does anybody know what i need to do to modify so it will work
    under OS/2? any gotchas? thanks

    i read that article, and there is a lot to go over. I will start that right now. Anyways, i got the actual stack trace
    from this error:
    at java.lang.Win32Process.create(Native Method)
    at java.lang.Win32Process.<init>(Win32Process.java:67)
    at java.lang.Runtime.execInternal(Native Method)
    at java.lang.Runtime.exec(Runtime.java:566)
    at java.lang.Runtime.exec(Runtime.java:428)
    at java.lang.Runtime.exec(Runtime.java:364)
    at java.lang.Runtime.exec(Runtime.java:326)
    at ReconnectReportServer.run(ReportServer.java:499)
    at java.lang.Thread.run(Thread.java:536)
    and, once again, i am running this on OS/2. I compiled it on OS/2 as well. Any ideas? thanks!

  • [SORRY] exec command problem for shell scripting

    I know this is not an appropriate place to ask questions about shell programming, but I have tried many other places... and no helpful help yet. So, here I am.
    I am writing a simple shell script that would actually execute a java application. However, I want to give the users the option of running it in background. So,
    COMMAND="java blahblah"
    DAEMON="&"
    exec "$COMMAND $DAEMON"
    But, when I run it, it spits out an error message saying something like "Invalid agrument: &".
    Is there a way to exec'ing "java blahblah &" using variables as arguments to "exec" command???
    OR is it even NOT possible?
    This problem seems so trivial, but took a man out of me. :( Please help.
    thanks
    yosep

    execute a java application. However, I want to give
    the users the option of running it in background. It doesn't generally make sense to exec an ansynchronous process, and one can introduce varying errors in this method. Just simply drop the exec. The java process will async off and the shell script will exit leaving no shell process running. Simple as that.
    BTW, you generally exec a java process if you wish to replace the shell with the java process, but then the async request is given at the caller, she who actually calls the script (genarally from an interactive shell).

  • Runtime exec command parameters with SSH

    hey,
    Im trying to run a unix command using Process proc = Runtime.getRuntime().exec(command);
    It works fine until I tried to combine it with multiple commands.
    For example, I'm trying to run:
    ssh [email protected] 'ls -al'
    This returns a exit value of -1, command not found.
    ssh [email protected] ls works fine so I suspect its related to the extra parameters.
    I checked the Javadoc page for exec:
    The command argument is parsed into tokens and then executed as a command in a separate process. The token parsing is done by a StringTokenizer created by the call:
    new StringTokenizer(command)
    As expected, it tokenized:
    ssh
    [email protected]
    'ls
    -al'
    Is there any way to bypass this default tokenization by exec to include quotes as one token?
    If anyone has any ideas, let me know! Thanks!

    thanks, solves that part.. but if i use execute command with ssh and bsub(a clustering job queue-submitter), it does ot return the correct value.
    For example, if i do ssh [email protected] bsub -I ls using exec and the waitFor() method, the waitFor waits indefinitely.
    I can tell it ran the job and ended, because i checked via bjobs and it finished. So why isn't the java app getting the exit code from waitFor() back?
    If I run the program on the targeted machine, bsub -I ls, it works correctly.
    If i type in the console, ssh [email protected] bsub -I ls, it returns back the results correctly.
    info regarding bsub and bjobs here http://www.ncsa.uiuc.edu/UserInfo/Resources/Hardware/XeonCluster/Doc/Jobs.html

  • Running jar in unix using runtime exec command

    Hi, i want to run a jar in unix with the runtime.exec() command,
    but i couldn't manage to do it
    Here is the code
    dene = new String[] {"command","pwd","java tr.com.meteksan.pdocs.pdf.html2pdf "+ f.getAbsolutePath() + " " + pdfPath};
              System.out.println("Creating PDF");
              FileOutputStream fos = new FileOutputStream(new File(pdfPath));
              Runtime rt = Runtime.getRuntime();
              for(int i = 0 ; i < dene.length ; i++)
                  System.out.println("komut = "+dene);
              Process proc = rt.exec(dene);
              // any error message?
              StreamGobbler errorGobbler = new StreamGobbler(proc.getErrorStream(), "ERROR"); // any output?
              StreamGobbler outputGobbler = new StreamGobbler(proc.getInputStream(), "OUTPUT", fos); // kick them off
              errorGobbler.start();
              outputGobbler.start();
              // any error???
              int exitVal = proc.waitFor();
              System.out.println("ExitValue: " + exitVal);
              fos.flush();
              fos.close();
    when i run this program, the exit value of the process is 0
    can you tell me whats wrong?

    i changed the string to be executed to:
                             dene = new String[] {"sh","-c","java -classpath \"" + Sabit.PDF_TOOL_PATH
                                  + "avalon-framework-4.2.0.jar:" + "" + Sabit.PDF_TOOL_PATH
                                  + "batik-all-1.6.jar:" + Sabit.PDF_TOOL_PATH
                                  + "commons-io-1.1.jar:" + Sabit.PDF_TOOL_PATH
                                  + "commons-logging-1.0.4.jar:" + "" + Sabit.PDF_TOOL_PATH
                                  + "fop.jar:" + Sabit.PDF_TOOL_PATH + "serializer-2.7.0.jar:"
                                  + Sabit.PDF_TOOL_PATH + "Tidy.jar:" + Sabit.PDF_TOOL_PATH
                                  + "xalan-2.7.0.jar:" + "" + Sabit.PDF_TOOL_PATH
                                  + "xercesImpl-2.7.1.jar:" + Sabit.PDF_TOOL_PATH
                                  + "xml-apis-1.3.02.jar:" + Sabit.PDF_TOOL_PATH
                                  + "xmlgraphics-commons-1.0.jar:" + "" + Sabit.PDF_TOOL_PATH
                                  + "html2pdf.jar:\" tr.com.meteksan.pdocs.pdf.html2pdf "
                                  + f.getAbsolutePath() + " " + pdfPath};     
    and it works now ;)
    thanks...

Maybe you are looking for