Results 1 to 4 of 4
  1. #1
    ktlim is offline Member
    Join Date
    Mar 2012
    Posts
    3
    Rep Power
    0

    Default Problem using Runtime.exec

    Hi all, I have some problems regarding the use of Process class.

    I have an external application that I need to call using Process. The external application that I use is BulkImageProcessor which is a plugin for Paint.Net. It can use command line parameters to call the functions of the program.

    In my code, I wrote something like this.

    Java Code:
    Runtime rt = Runtime.getRuntime();
    String command = "C:\\Paint.NET\\PDNBulkUpdaterCmd.exe ";
    command += "\"C:\\pictures\\*.*\" ";
    command += "\"\/oC:\\pictures\\converted\" ";
    command += "/alg:bicubic ";
    command += "/oft:jpg";
    
    Process p = rt.exec(command);
    Java Code:
    Fatal Error: Could not locate PDNBulkUpdater.dll!
    System.IO.FileNotFoundException: The system cannot find the file specified. (Exception from HRESULT: 0X8007002)
      at System.Reflection.Assembly.nLoadFile(String path, Evidence evidence)
      at System.Reflection.Assembly.LoadFile (String File)
      at PDNBulkUpdaterCmd.Program.Main(String[] args)
    I am not sure what went wrong because when I try to execute in the command prompt, the command works. Did I miss out anything?

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,407
    Rep Power
    20

    Default Re: Problem using Runtime.exec

    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  3. #3
    sarcoex is offline Freelance Java Programmer
    Join Date
    Feb 2012
    Location
    Norway
    Posts
    3
    Rep Power
    0

    Default Re: Problem using Runtime.exec

    You need to have PDNBulkUpdater.dll in the working directory of the java programme.

  4. #4
    ktlim is offline Member
    Join Date
    Mar 2012
    Posts
    3
    Rep Power
    0

    Default Re: Problem using Runtime.exec


    Cross posted
    problem using the Runtime.exec() (Java in General forum at JavaRanch)

    db
    @DarrylBurke Sorry about cross post. i will take note of that.

    You need to have PDNBulkUpdater.dll in the working directory of the java programme.
    @sarcoex I will try it later.

Similar Threads

  1. problem with Runtime.getRuntime().exec when running java in .bat
    By Shayko in forum Threads and Synchronization
    Replies: 2
    Last Post: 01-27-2010, 07:46 PM
  2. Problem with Runtime.getRuntime().exec with Linux Commands
    By swapnilnawale in forum Threads and Synchronization
    Replies: 1
    Last Post: 09-23-2009, 10:23 PM
  3. runtime.exec
    By cotede2 in forum Advanced Java
    Replies: 3
    Last Post: 04-17-2009, 05:18 PM
  4. Runtime.exec()
    By hknyo in forum Advanced Java
    Replies: 2
    Last Post: 08-16-2008, 12:40 AM
  5. Problem with Runtime.exec()
    By nhabibi in forum Advanced Java
    Replies: 11
    Last Post: 07-02-2008, 01:35 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •