Results 1 to 4 of 4

Thread: Executing Perl!

  1. #1
    hakan123 is offline Member
    Join Date
    Nov 2009
    Posts
    13
    Rep Power
    0

    Default Executing Perl!

    Hello All!
    I am new to java. i want to run my perl script from java. i dont know what mistake i am doing, i am not able to execute my perl script. i can call my perl script with two arguments. i am able to run it successfully when i made a batch file. i dont know why it is not working in java. following is the code.

    try
    {
    pathn1 = "C:\\Program Files\\jambo\\gritchy\\kakae";
    fname1 = alpine.wav ;
    Process p = Runtime.getRuntime().exec("C:/perl/bin/perl.exe C:\\Perl\\scripts\\varm.pl \"pathn1\" fname1");
    int fg = p.waitFor();
    if (fg == 0)
    {
    loginfo("successfull");
    }

    else {
    loginfo("failed");
    }

    }
    catch(Exception e)
    {
    loginfo("Exception running varm");
    }

    Please help me

  2. #2
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,519
    Blog Entries
    7
    Rep Power
    20

    Default

    Don't double post.

    kind regards,

    Jos

  3. #3
    hakan123 is offline Member
    Join Date
    Nov 2009
    Posts
    13
    Rep Power
    0

    Default

    ok,Sorry Joash..i was just confused that if it could be better to put this problem infront of experts..
    i will not do it agian.:)

  4. #4
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

Similar Threads

  1. Replies: 1
    Last Post: 01-07-2011, 07:20 AM
  2. Perl in Java!
    By hakan123 in forum New To Java
    Replies: 5
    Last Post: 12-11-2009, 07:05 PM
  3. [B] How to call Perl script from Java [/B]
    By JavaEmpires in forum Advanced Java
    Replies: 7
    Last Post: 12-19-2008, 03:10 PM
  4. run perl script from java
    By maheshmhs in forum New To Java
    Replies: 0
    Last Post: 12-19-2008, 12:40 PM
  5. Use Perl function with java
    By lenny in forum Advanced Java
    Replies: 1
    Last Post: 08-07-2007, 06:25 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
  •