Execute exe From Within Prject Folder

Hey Everyone,
I have an executable file which carry's out some calculations that I have placed in my project folder. The file resides in /utilities/ImageExtracter.exe that is a folder called utilities under the root folder. I am currently executing the exe using the following code:
               Process process = new ProcessBuilder(NEED RELATIVE ADDRESS HERE , documentPath,outputPath).start();
Please let me know how I can get the address of the file as a string to use in the above code segment.
Thanks,
Nath5

896350 wrote:
               Process process = new ProcessBuilder(NEED RELATIVE ADDRESS HERE , documentPath,outputPath).start();Relative to what? Your "project"? There's no such thing as a "project" in Java. That's purely a construct of your IDE. Java code isn't usually run in an IDE except during development time for testing. My suggestion is to abandon the IDE, and write your code with a text editor or programmer's editor, and compile and run on the command line. That way there will be less chance of conflating the tools with the Java language and API.
If you're going to insist on continuing with the IDE, then your question of how to find the "project" folder is best addressed to that IDE's support forum or whatever they offer.

Similar Messages

  • Trying to run an .exe from within pdf

    I am trying to run an executable file from within a pdf.  I get the error "This file is set to be launched by this pdf file.  This is currently disallowed by your administrator."  Error box is labeled "acrobat.exe"
    Using:  Adobe Acrobat 9 pro
    Windows 7
    This has worked with previous versions of Acrobat, is it still possible to do?

    This is disallowed for security reasons.
    See the "attachment configuration" section at : http://learn.adobe.com/wiki/display/security/Application+Security+Library to change this behavior.

  • Starting notepad.exe from within Java app?

    Is it possible to start notepad.exe from within a java app to display a log file (for instance)?

    search the forum for Runtime.getRuntime()

  • Calling startrfc.exe from within a vbs script

    Hello, can someone help me please
    I am trying to process xml idocs into SAP on a Windows 2008 server. I have written a vbs script to process the file and am trying to call STARTRFC.EXE from within the vbs script. However I keep getting an error that it cannot open the file. The code is shown below. I have changed the server name and gateway and user/passwd for security. I'm passing the filename as a variable (str_expfile) but it does not seem to be able to extract the actual file name from the variable. I know from past experience that you can pass it variables if its running on a unix box and in a shell. But for some reason it not decipering the variable name in the vbs script
    Set objShell = CreateObject("Wscript.Shell")
    str_startrfc = "D:\usr\sap\SID\SYS\exe\uc\NTAMD64\startrfc.exe -d SID -3 -h hostname -s 00 -g hostname -x sapgw00 -u user -p passwd -c 100 -l EN -t -F EDI_DATA_INCOMING -E PORT=MYPORT -E PATHNAME=str_expfile"
    objShell.Run str_startrfc, ,True
    The error I'm getting is shown below:
    ERROR file opened at 20110510 134219 GMT Daylight Time, SAP-REL 700,0,278 RFC-VER 3 1200864 MT-SL
    T:2584 Error in program 'startrfc': ======> Error at OPEN 'str_expfile' (check file)
    T:2584 Error in program 'startrfc': <* RfcReceive [1] : returns 3:RFC_SYS_EXCEPTION
    T:2584 Error in program 'startrfc': <* RfcCallReceive [1] : returns 3:RFC_SYS_EXCEPTION
    Thanks
    Regards
    Steve

    Hi Markus
    Unfortunately I can't do that because I need it to process hundreds of files one after another and I would have to hard code the file path each time. That's why I need it automated.
    Can startrfc.exe not take a variable for the pathname in a vb script? It works fine in a unix shell. We are migrating from unix to windows and I need to convert all my unix scripts into vb scripts.
    I notice there is a nother rfc type program available, can I use rfcexec.exe instead of startrfc.exe and would it take variables?
    Thanks
    Regards
    Steve

  • My company blocks executables from running in the Temp folder. How can I install Firefox without it trying to run download.exe from a temp folder?

    I found a workaround for the problem of not being able to run executables from the Temp folder.
    I happened upon the Full Firefox installer download page. I downloaded the full installer and used WinRar to extract the downloaded file to a folder then I could run setup.exe and Firefox installed successfully.
    Please publish the link to the full Firefox installer on the same page where the stub installer is published.
    Thank you.

    Hello,
    Full installers can always be downloaded here:
    * https://www.mozilla.org/en-US/firefox/all/
    I am assuming you went to this page:
    * https://www.mozilla.org/en-US/firefox/new/
    I notice the page has changed a little from the last time I saw it, but you can reach the first link I posted by clicking "Systems & Languages".

  • Running an exe from within Oracle WebLogic 10g R3 does not find dll

    Hi,
    I am facing a strange issue with Oracle WebLogic 10g R3.
    I use the code as shown in Listing 1 below to run a windows based application exe (batch job) from within my web application hosted on Oracle WebLogic 10g Release 3.
    Note that this code woks fine on Tomcat 6.x and OC4J (JDeveloper TP4).
    The exec gets executed but the log of the exe program shows it could not load certain DLLs.
    Note that these DLLs are in the same directoy as the Batch program and this directory is in the PATH.
    Running through simple Java Program Successful*
    When I run the same program from a java program it runs successfully. So this means some WebLogic environment does not get set properly.
    Running directly BatchProg.exe rather than cmd.exe fails*
    Also note that when I run the exe directly e.g. BatchProg.exe rather than through cmd.exe it gives me a error the system did not find the file specified.
    CreateProcess error=2, The system cannot find the file specified with cause java.io.IOException: CreateProcess error=2, The system cannot find the file specified
    Listing 1:*
    String[] commandArgs = new String[|http://forums.oracle.com/forums/] { "cmd.exe", "/C", "BatchProg.exe \"param1\" \"param2\" " },null , l_workingDir)
    Runtime rt = Runtime.getRuntime();
    Process proc;
    proc = rt.exec( commandArgs, envParams, workingDir );
    ProcessIO errStream = new ProcessIO( proc.getErrorStream(), "ERROR");
    ProcessIO outStream = new ProcessIO( proc.getInputStream(), "OUTPUT");
    errStream.start(); // process any errors from the command
    outStream.start(); // process any output from the command
    System.out.println("Error=" +errStream);
    System.out.println("Out" + outStream);
    return (p_waitToFinish ? proc.waitFor() : this.SUCCESS);

    OK.
    I have posted this on the WebLogic Forum.
    Thanx.

  • Problem  in executing EXE from browser-URGENT

    Hi all,
    I am facing a problem in executing "c exe" file from my web based application, iam using IAS
    on Solaris. my program is able to catch the path but its not executing (this is wirking fine in windows) i am giving a sample code here
    Runtime rt=Runtime.getRuntime();
    Process pro=rt.exec("/datadisk1/java/runsol.exe");
    pro.waitFor();
    runsol.exe will generate s text file when executed, when i run this in a independent java program then it is executing, on browser it is not executing and output text file is not creating.
    Note: i am working on Solaris / Oracle AS 9i
    Thanks
    Bye.

    Security issue. Calling .exe from applet not possible by default.

  • Executing JRE from within C in Linux

    Hello,
    I tried to execute the JRE and give it some arguments (In fact my Java application) from within C. I used the library function
    execl(...) to make this.
    Unfortunately I got error "Could not load JRE" and some
    shared object error.
    Anyone any ideas how I can execute my Java Application from within C in Linux?
    thx Fatih

    Look up Janava Native Interface (JNI), and specifically the invocation interface.

  • Executing vbscript from within java

    Hi,
    Does anyone knows a way to execute a vbscript from within java and capture its output.
    thanks

    Do you mean emulate an interpreter?

  • Launching/executing files from within AIR

    Hi.
    Just wanted to know if I can launch files from within my AIR
    app...for instance I would like the user to click a button which
    then opens a Microsoft Word doc...the Word doc doesn't have to open
    in the AIR app, it can open on the desktop (Windows XP).
    Thanks for the help.

    Mike provided a good proof here:
    http://www.mikechambers.com/blog/2008/01/17/commandproxy-net-air-integration-proof-of-conc ept/
    HTH

  • [Solved]Can sox use thunar's synatax to add wavs from within a folder?

    Sorry I renamed this topic to be more specific to the issue(re-edit: oops that was a terrible subject title earlier I must've rushed when editing.)
    NOTE:A workable solution is in my last post...
    Ok I'm trying to configure Thunar to run a simple script(basically an executable text file with a string using sox to concatenate a series of wavs within the working directory and referenced within .bashrc with a simpler alias.)
    the alias works after  few trials and errors I had to write the string with its arguements in a text file make it executable.
    The alias looks like this
    alias makegapless='~/.gaplessscript'
    and the command string used in ".gaplessscript" is
    sox --combine concatenate (ls|grep .wav) gapless.wav
    this just tells sox to combine a series of .wav's into one continuous track and output it into the same working directory with the genaric name "gapless.wav" which is a lot faster than using audacity or something similar to get the same results.
    My goal is to pass this command to thunar with a custom action and tell it to point inside a selected directory with .wav's so all i have to do is right click the folder and run the command without opening a terminal into the directory
    Any suggestions on how to write this in thunar's custom actions. I tried several using the the parameters suggested in thunars custom actions window but none seem to work. what would be the syntax or lines tp include in the string so that this can be done? I have a few custom actions already configured but can't seem to figure this one out...
    Last edited by Thme (2012-05-27 20:10:47)

    Ok so apparently This is an issue with sox only taking certain syntax. and the paths sent to it by thunar aren't recognized when deling with folders? I was able to get results with both my posted command and the one suggested by trilby when testing it in the cli. but when trying to intoduce those paths to be specified with thunar when running sox as an action strangely this sting works in the custom actions with out a script but has a disadvantage.
    sox --combine concatenate %F gapless.wav
    Doing it this way I have to highlight the audio files specifically(will take other supported formats like ogg, mp3 and flac etc. and convert them as well). If any unsupported type is highlighted it won't run. I tried the different options %d %D etc just to see if anything worked but as i already thought it didn't. arranging the ls|grep or find strings into this got nothing. I went through about as many possible strings i could think of  even ones i was sure wouldn't work. I'm marking this as solved as i did get at least a working menu action just not exactly what i wanted. but any further insight would be appreciated. maybe i'm just missing something really simple.

  • How to open an executable file from within Captivate

    Hi guys,
    I wondered if any of you guys could help me...
    I am using Captivate 3 and I have created a project in this and exported it as a standalone executable file.
    Ideally I would like to link this to another standalone executable file exported from Captivate, so is it possible
    to create a button in the first file so when it has been exported, if I click on this it opens up the second standalone file?
    Thanks for your help in advance.
    br

    I'm pretty sure that, for security reasons, the projector app that Captivate uses for stand-alone EXEs is sandboxed: you won't be able to access the API of the host operating system, so you won't be able to launch any apps.

  • Running executable jar from within a java program

    Is there a way to launch an executable jar in a java program? I tried wrapping the jar in an exe and calling it using Runtime exec() and though this approach works it does only for windows. I want it to work for unix/linux too.

    jaki wrote:
    Yes, but it's a sub process.Nope.
    Hence the calling process doesn't quit unless the called one returns.Wrong.
    My calling program is actually a jar and what Im trying to do is delete the jar after it's done running. But the above method (of launching a separate jar doing the deletion) doesn't seem to work for the above mentioned reason.Wrong.
    If you could tell me any other way it would really be a big help.You don't need any other way. Maybe you need to allow some time for the calling program to wind up. 20 seconds may be overkill, but I'm not in the mood to find how short it can be and still succeed.
    The two classes are packaged in separate jars.import java.io.IOException;
    public class Deletee {
        public static void main(String[] args) {
          try {
             String[] cmds = {"java", "-jar", "E:/temp/Deleter.jar"};
             Runtime.getRuntime().exec(cmds);
             System.exit(0);
          } catch (IOException ex) {
             ex.printStackTrace();
    import java.io.File;
    import javax.swing.JOptionPane;
    public class Deleter {
       public static void main(String[] args) {
          File file = new File("E:/temp/Deletee.jar");
          try {
             Thread.sleep(20000);
          } catch (InterruptedException ex) {
             ex.printStackTrace();
          if (file.delete()) {
             JOptionPane.showMessageDialog(null, "Deleted");
          } else {
             JOptionPane.showMessageDialog(null, "Oops");
    }Try it and see for yourself.
    db

  • PL/SQL: Executing a procedure from within another procedure

    Hello, I'm a newbie and I need help on how to execute procedures from within another procedure. The procedure that I call from within the procedure have return values that I want to check.
    I tried: EXECUTE(user_get_forum_info(p_forumid, var_forum_exists, var_forum_access, var_forumname));
    but I get the error message:
    PLS-00103: Encountered the symbol "USER_GET_FORUM_INFO" when expecting one of the following::= . ( @ % ; immediate
    The symbol ":=" was substituted for "USER_GET_FORUM_INFO" to continue.
    And when I tried: EXECUTE(user_get_forum_info(p_forumid, var_forum_exists, var_forum_access, var_forumname));
    I get the error message:
    PLS-00222: no function with name 'USER_GET_FORUM_INFO' exists in this scope
    PL/SQL: Statement ignored
    The procedure USER_GET_FORUM_INFO exists. (don't understand why it says "no FUNCTION with name", it's a procedure I'm executing)
    I'm stuck so thanks for any help...
    Below is all the code. I'm using Oracle 9i on RedHat Linux 7.3.
    ================================================================================
    CREATE OR REPLACE PROCEDURE user_forum_requestsaccess (
    p_forumid IN NUMBER,
    p_requestmessage IN VARCHAR2
    AS
    var_forumid NUMBER;
    var_forum_exists NUMBER;
    var_forum_access NUMBER;
    request_exists NUMBER;
    var_forumname VARCHAR2(30);
    FORUM_DOESNT_EXIST EXCEPTION;
    FORUM_USER_HAS_ACCESS EXCEPTION;
    FORUM_REQUEST_EXIST EXCEPTION;
    BEGIN
    SELECT SIGN(NVL((SELECT request_id FROM forum.vw_all_forum_requests WHERE forum_id = p_forumid AND db_user = user),0)) INTO request_exists FROM DUAL;
    EXECUTE(user_get_forum_info(p_forumid, var_forum_exists, var_forum_access, var_forumname));
    IF var_forum_exists = 0 THEN
    RAISE FORUM_DOESNT_EXIST;
    ELSIF var_forum_access = 1 THEN
    RAISE FORUM_USER_HAS_ACCESS;
    ELSIF request_exists = 1 THEN
    RAISE FORUM_REQUEST_EXIST;
    ELSE
    INSERT INTO tbl_forum_requests VALUES (SEQ_TBL_FORUM_REQ_REQ_ID.NEXTVAL, SYSDATE, p_requestmessage, p_forumid, user);
    INSERT INTO tbl_forum_eventlog VALUES (SEQ_TBL_FORUM_EVNTLOG_EVNT_ID.NEXTVAL,SYSDATE,1,'User ' || user || ' requested access to forum ' || var_forumname || '.', p_forumid,user);
    COMMIT;
    END IF;
    EXCEPTION
    WHEN
    FORUM_DOESNT_EXIST
    THEN RAISE_APPLICATION_ERROR(-20003,'Forum doesnt exist.');
    WHEN
    FORUM_USER_HAS_ACCESS
    THEN RAISE_APPLICATION_ERROR(-20004,'User already have access to this forum.');
    WHEN
    FORUM_REQUEST_EXIST
    THEN RAISE_APPLICATION_ERROR(-20005,'A request to this forum already exist.');
    END;
    GRANT EXECUTE ON user_forum_requestsaccess TO forum_user;
    ================================================================================
    Regards Goran

    you don't have to use execute when you want to execute a procedure (only on sql*plus, you would use it)
    just give the name of the funtion
    create or replace procedure test
    as
    begin
        dbms_output.put_line('this is the procedure test');
    end test;
    create or replace procedure call_test
    as
    begin
        dbms_output.put_line('this is the procedure call_test going to execute the procedure test');
        test;
    end call_test;
    begin
        dbms_output.put_line('this is an anonymous block calling the procedure call_test');
        call_test;
    end;
    /

  • How to execute a Perl program from within a Java prog

    How do I execute a Perl program from within a Java program.
    Lets say the Perl program that I want to execute is 'abc'. Now, 'abc' requires some input that I want to give it from within the Java program. How do I do it?
    And finally, how do I execute that Perl program from within the Java program.
    If I execute the Perl program alone then I do it in the following way -
    perl abc inp1 inp2 inp3
    where inp1, inp2, inp3 are inputs to the Perl program. I will not be able to change or modify the coding of the Perl program - 'abc' as I do not have access to its code. Its a kind of an application whose usual method of execution is in the above shown way. So, how do I execute 'abc' from within a Java program.

    what part of don't crosspost, don't you understand?
    http://forum.java.sun.com/thread.jsp?forum=4&thread=427193

Maybe you are looking for

  • How to remove history on ipod when i no longer have the ipod

    Hi so i recently gave my nephew my ipod touch while after thinking about it i really dont want him to be able to download anything with my credit card number is there any way i can remove it even though its no longer in my possen?

  • Error when editing a Web Template

    Hi, I have a Web Template created in BW 3.5, When I edit the template in web application designer  and run it in browser it gives some junk.  Is there any other way by which I can edit the template. Thanks. Edited by: SAPBILearner on Apr 15, 2010 10:

  • Free VU and EQ animation plugins now available

    Hi there I've just released VeeYou: Four completely free fxplug plugins which generate animated VU and EQ effects from the audio in your project using audio behaviors in Motion 3. details on CoreMelt VeeYou: http://www.coremelt.com/products/products-

  • StackOverflowError during BPEL transformation

    Hi, I am consuming the webservice of a external company. The webservice returns 5 mb of data with 3777 elements of a complex type with 20 simple types that I need to transform into another complex type with 17 simple types. The transformation is a si

  • Buying a photo book

    I am in Brazil and Iphoto book printing is not available here. However, my aunt lives in Connecticut and I wanted to print and ship book to her address. Is that possible? I dont seem to be able to connect when i try to place my order. What can I do?