Runtime.exec error on Fedora Core

Hi,
I have some difficulty using Runtime.exec method on Fedora Core.
If classpath contains "space", it cannot execute a commnad.
It works well on Windows systems with quotation marks.
Here's my code.
Proccess p = r.exec("java -classpath .:\"pkg root"\" A");
Java command regards root as a class. It is actually a half of directory name. How can I solve this problem?
thank you for reading.

This setting works for me on Linux:
[ebank2@giskard ivan]$ java b
here is a - have a nice day![ebank2@giskard ivan]$ cat "a b"/a.java
public class a {
public static void main (String a[] ) {
System.out.println("here is a - have a nice day!");
}[ebank2@giskard ivan]$ cat b.java
import java.io.*;
public class b {
static String s[]={ "java" , "-classpath" , "a b" , "a" };
public static void main (String a[] ) throws Exception {
Process p =  Runtime.getRuntime().exec(s);
InputStream is = p.     getInputStream() ;
int c;
while((c=is.read()) != -1) System.out.print((char)c);
}

Similar Messages

  • Runtime.exec error - java.lang.NullPointerException

    Hi,
    I am trying out the example code from javaWorld that shows how to use exec to execute external command. The problem is that I aways run into java.lang.NullPointerException on line that has "Process proc = rt.exec(cmd);" I have tried to run the code under Windows XP and Windows 2003; and I get the same error message. Any idea on what might be casing this?
    Thanks,
    // GoodWindowsExec.java
    import java.util.*;
    import java.io.*;
    class StreamGobbler extends Thread
    InputStream is;
    String type;
    StreamGobbler(InputStream is, String type)
    this.is = is;
    this.type = type;
    public void run()
    try
    InputStreamReader isr = new InputStreamReader(is);
    BufferedReader br = new BufferedReader(isr);
    String line=null;
    while ( (line = br.readLine()) != null)
    System.out.println(type + ">" + line);
    } catch (IOException ioe)
    ioe.printStackTrace();
    public class GoodWindowsExec
    public static void main(String args[])
    if (args.length < 1)
    System.out.println("USAGE: java GoodWindowsExec <cmd>");
    System.exit(1);
    try
    String osName = System.getProperty("os.name" );
    String[] cmd = new String[3];
    if( osName.equals( "Windows NT" ) )
    cmd[0] = "cmd.exe" ;
    cmd[1] = "/C" ;
    cmd[2] = args[0];
    else if( osName.equals( "Windows 95" ) )
    cmd[0] = "command.com" ;
    cmd[1] = "/C" ;
    cmd[2] = args[0];
    Runtime rt = Runtime.getRuntime();
    System.out.println("Execing " + cmd[0] + " " + cmd[1]
    + " " + cmd[2]);
    Process proc = rt.exec(cmd);
    // any error message?
    StreamGobbler errorGobbler = new
    StreamGobbler(proc.getErrorStream(), "ERROR");
    // any output?
    StreamGobbler outputGobbler = new
    StreamGobbler(proc.getInputStream(), "OUTPUT");
    // kick them off
    errorGobbler.start();
    outputGobbler.start();
    // any error???
    int exitVal = proc.waitFor();
    System.out.println("ExitValue: " + exitVal);
    } catch (Throwable t)
    t.printStackTrace();
    }

    What is System.getProperty("os.name") returning when you run on Windows XP or 2003?
    You are only filling in your cmd array when os.name is either Windows NT or Windows 95. In other cases, the elements of cmd are left as null.
    The documentation for Runtime.exec() says you will get a NullPointerException when elements of the array are null:
    http://apidoc.org/view/10563?a=exec%28java.lang.String%5B%5D%29

  • Runtime.exec error in windows

    When i try to run an external program with Runtime.exec() in windows 2000, i get a windows pop-up with the following error msg:
    d:\winnt\system32\ntvdm.exe
    Error while setting up environment for the application.
    I have no idea how to fix this since i have no clue to what that error means.
    Thanks
    Rumy

    I've personally just encountered the same error. I am building a piece of demonstration software to distribute with my graduate school applications to demonstrate my programming experience and I wish to include a set of programs I wrote some years ago in Pascal and C++. The software has been compiled for MS-DOS 6.0. I am using the following command to execute the software from within my Java program:
    Runtime.getRuntime().exec(new String[]{"command.com","/c","12cards.bat"});The batch file performs the appropriate setup operations for the program and runs the executable. When I run this code segment, I receive the following error:
    [16 bit MS-DOS Subsystem]
    C:\WINNT\system32\ntvdm.exe
    Error while setting up environment for the application. Choose 'Close' to terminate the application.
    I have another code segment in which I attempt to run the executable myself (without the help of command.com or the batch file). The code segment is as follows:
    Runtime.getRuntime().exec(new String[]{"12cards.exe"}, new String[0], workingDir);When I run this code segment, the following IOException is thrown:
    java.io.IOException: CreateProcess: 12CARDS.EXE error=2
         at java.lang.Win32Process.create(Native Method)
         at java.lang.Win32Process.<init>(Win32Process.java:66)
         at java.lang.Runtime.execInternal(Native Method)
         at java.lang.Runtime.exec(Runtime.java:566)
         at (my code)I have already found the document on Microsoft's support website which describes a solution to this problem. Manually extracting the autoexec.nt, config.nt, and command.com files from the installation CD-ROM did not help.
    The most confusing element of this: 12CARDS.EXE runs fine if I execute it from Windows Explorer. It's only a problem if it's executed from within my Java program. I have two other DOS programs which I want to include as well; I am having the same trouble with them.
    Any advice will be much appreciated. Thanks!

  • Runtime.exec() error codes

    I am getting the following exception when I try doing...
    r.exec ( "cmd/c start/b notepad" );
    Want to diagnose but don't see the errorcode any where documented.
    thanks in advance.
    java.io.IOException: CreateProcess: start dir error=2
    at java.lang.Win32Process.create(Native Method)
    at java.lang.Win32Process.<init>(Win32Process.java:63)
    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 com.ugsolutions.aif.installer.Installer.main(Unknown Source)

    hi I am having the same problem. I have a .cmd file that needs an arguement to run. The .cmd file connects to a server via PSCP. The .cmd file works properly on it's own on the commandline with an appropriate arguement, but as for using it thru the java file - it doesnt even hang, it just doesnt execute. Can anyone help me please?
    Fin.
    CODE:
    import java.io.*;
    class ExecDemo
         public static void main(String[] args) throws IOException
              //if( args.length < 2 )
              //     System.out.println( "Please specify parameters" );
              //else
                   //System.out.println( args[0] );
                   //System.out.println( args[1] );
                   String command;
                   command = "/cmd -c package.cmd 331/Finbarr/*";
                   System.out.print( command );
                   Runtime rt = Runtime.getRuntime ();
                   try
                        Process rtProcess = rt.exec ( command ); //
                        // Print command output onto standard output
                        InputStream is = rtProcess.getInputStream();
                        InputStreamReader isr = new InputStreamReader(is);
                        BufferedReader br = new BufferedReader(isr);
                        String str;
                        System.out.println();
                        System.out.println("starting...");
                        int i = 0;
                        while ((str = br.readLine()) != null)
                             System.out.println(i + " " + str);
                             i ++;
                        is.close();
                        System.out.println("over...");
                        try
                             rtProcess.waitFor();
                        catch (InterruptedException ire)
                             ire.printStackTrace();
                   catch (IOException ioe)
                        ioe.printStackTrace();
    }

  • ORA-12560: TNS:protocol adapter error on Fedora Core 5

    Hi ,
    After installing the 10201_database_linux_x86_64 on Fedora Core5. The database is started fine on the server. The status of is Listener is also up. But when try to connect from client PC. I am getting ORA-12560: TNS:protocol adapter error error please help. me.
    Thanks,

    Here are my config files.
    On SERVER
    listener.ora
    # Generated by Oracle configuration tools.
    SID_LIST_LISTENER =
    (SID_LIST =
    (SID_DESC =
    (SID_NAME = PLSExtProc)
    (ORACLE_HOME =/u01/app/oracle/product/10.2.0/db_1)
    (PROGRAM = extproc)
    (SID_DESC =
    (SID_NAME = db10g)
    (ORACLE_HOME = /u01/app/oracle/product/10.2.0/db_1)
    (PROGRAM = extproc1)
    LISTENER =
    (DESCRIPTION_LIST =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
    (ADDRESS = (PROTOCOL = TCP)(HOST = xxxxx)(PORT = 1521))
    (ORACLE_HOME = /u01/app/oracle/product/10.2.0/db_1)
    sqlnet.ora
    # Generated by Oracle configuration tools.
    SQLNET.AUTHENTICATION_SERVICES = (NTS)
    NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT, HOSTNAME)
    tnsnames.ora
    # Generated by Oracle configuration tools.
    DB10G =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = xxxx)(PORT = 1521))
    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SERVICE_NAME = DB10G.WORLD)
    EXTPROC_CONNECTION_DATA =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
    (CONNECT_DATA =
    (SID = PLSExtProc)
    (PRESENTATION = RO)
    now when I issue lsnrctl start db10g i am getting following error.
    TNS-01151: Missing listener name, db10g, in LISTENER.ORA
    Please help me.

  • Error while installing Oracle 10g on Fedora Core 1

    Error while installing Oracle 10g on Fedora Core 1. After 40% of the Installation is thru, the progress bar is showing 40%, it gives error "Not connected to Oracle" and the installation has to be terminated.
    We have tried by using the on-line procedure and changing the required script to make believe it as said.

    Are you createing DB also???

  • Error in opening a file with name in chinese characters with Runtime.exec

    The issue at hand is when I try to open a file with file name containing chinese characters in a localized environment in Windows through the following java code:
    Runtime.exec("rundll32 SHELL32.DLL,ShellExec_RunDLL {File_With_FileName_containing_Chinese_character}");
    the following error is thrown by windows.
    Cannot open file "C:\??.txt".
    with the exception
    java.io.IOException: CreateProcess: [Ljava.lang.String;@f5da06 error=2
            at java.lang.Win32Process.create(Native Method)
            at java.lang.Win32Process.<init>(Win32Process.java:66)
            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 Launcher.main(Launcher.java:26)
    When I try to use the same command (shown below) from the Windows Run command, the file opens sucessfully
    rundll32 SHELL32.DLL,ShellExec_RunDLL {File_With_FileName_containing_Chinese_character}
    Please suggest.
    Thanks in advance

    This may be a file association problem.  To solve that:
    In Windows 7:
    1. Right-click the file,
    2. Select "Open With" 
    select [Your Program Here]
    3. Check always use this program. 
    In Windows XP:
    1. Locate the file as you have described above
    2. Right click the file
    3. Select Open with from the pop-up menu
    4. Click Choose default program…
    5. Select Excel in the Recommended Programs box
    6. Check Always use the selected program to open this kind of file
    7. Click on OK.
    1.  Make Excel not available from Office 2007 listed under Programs and Features in Control Panel.
    2. Take a registry backup using the steps given here
    3. In the registry editor window expand HKEY_CLASSES_ROOT and navigate to .xls right and delete it.
    4. Exit Registry Editor
    5. Undo Step 1 to make Excel available.
    6.  Restart the computer and verify it the issue is fixed.
    If this answer solves your problem, please check Mark as Answered. If this answer helps, please click the Vote as Helpful button. Cheers, Shane Devenshire

  • Fedora Core 6 Installation Errors

    Attempting to install Coldfusion on a Linux Fedora Core 6
    Server, and the error message I'm getting is this:
    quote:
    [root@master slokie]# ./coldfusion-702-lin.bin
    Preparing to install...
    Extracting the JRE from the installer archive...
    Unpacking the JRE...
    Extracting the installation resources from the installer
    archive...
    Configuring the installer for this system's environment...
    awk: error while loading shared libraries: libdl.so.2: cannot
    open shared object file: No such file or directory
    dirname: error while loading shared libraries: libc.so.6:
    cannot open shared object file: No such file or directory
    /bin/ls: error while loading shared libraries: librt.so.1:
    cannot open shared object file: No such file or directory
    basename: error while loading shared libraries: libc.so.6:
    cannot open shared object file: No such file or directory
    dirname: error while loading shared libraries: libc.so.6:
    cannot open shared object file: No such file or directory
    basename: error while loading shared libraries: libc.so.6:
    cannot open shared object file: No such file or directory
    Launching installer...
    grep: error while loading shared libraries: libc.so.6: cannot
    open shared object file: No such file or directory
    /tmp/install.dir.7760/Linux/resource/jre/bin/java: error
    while loading shared libraries: libpthread.so.0: cannot open shared
    object file: No such file or directory
    These SO's exist in the /lib folder. Where is it trying to
    look and has anyone found it to work on a standard webserver with
    fc6?

    Review Steve's blog at
    http://www.talkingtree.com/blog/index.cfm/2006/12/6/Running-ColdFusion-MX-7-on-Fedora-Core -6-Linux.
    Read the links, too. This is an old topic now and a pretty standard
    installation procedure for installing CFMX on the newer unsupported
    linux platforms. I have used it for Mandriva and others.

  • Error starting SQLPLUS after updating Fedora Core 5

    Hi,
    I ran "yum update" on fedora core 5 and now sqlplus does not start anymore. I get this error:
    sqlplus: error while loading shared libraries: /opt/oracle/xe/app/oracle/product/10.2.0/server/bin/../lib/libnnz10.so: cannot restore segment prot after reloc: Permission denied
    I understand it has something to do with the SELinux policy but how can I configure my system so Oracle still works AND the security policy still works ?
    Thanks !!!
    Coen

    Hello,
    This solution ( tail -f /var/log/audit/audit.log |tee oracle.log; audit2allow -M oracle < oracle.log; semodule -i oracle.pp)
    worked for me. Can somebody explain what it did (I don't understand from the man pages)? ALso, how did this come to be. This happened to me right after a fresh install, and the machine got bounced.
    All answers are apprecaited.
    Thanks,
    Edited by: user8674025 on Nov 27, 2009 9:59 AM

  • Sjsws 7 sp5 on fedora core 10 compile error on php 5.2.9

    I am trying to compile php 5.2.9 and get the following error during make: sapi/nsapi/nsapi.c:62:19: error: nsapi.h: No such file or directory
    There was a post (http://developers.sun.com/webtier/reference/techart/php2.html) which seemed to address this problem, but it didn't fix the issue. Also, I have searched for nsapi.h and it is not on the system anywhere... Has anyone come across this problem or have suggestions on how to resolve it?
    OS: fedora core 10
    SJSWS: 7.0 sp5
    ./configure with-mysql with-nsapi=/opt/iplanet/current enable-libgcc with-gd=/usr --enable-sockets
    /bin/sh /root/installs/php/php-5.2.9/libtool silent preserve-dup-deps --mode=compile /root/installs/php/php-5.2.9/meta_ccld  -IZend/ -I/root/installs/php/php-5.2.9/Zend/ -DPHP_ATOM_INC -I/rootinstalls/php/php-5.2.9/include -I/root/installs/php/php-5.2.9/main -I/root/installs/php/php-5.2.9 -I/opt/iplanet/current/include -I/opt/iplanet/current/plugins/include -I/usr/include/libxml2 -I/rot/installs/php/php-5.2.9/ext/date/lib -I/usr/include/mysql -I/root/installs/php/php-5.2.9/TSRM -I/root/installs/php/php-5.2.9/Zend  -D_REENTRANT -DTHREAD=1  -I/usr/include -g -O2 -pthread -DZTS  -refer-non-pic -c /root/installs/php/php-5.2.9/Zend/zend_objects_API.c -o Zend/zend_objects_API.lo
    /bin/sh /root/installs/php/php-5.2.9/libtool silent preserve-dup-deps --mode=compile /root/installs/php/php-5.2.9/meta_ccld  -IZend/ -I/root/installs/php/php-5.2.9/Zend/ -DPHP_ATOM_INC -I/rootinstalls/php/php-5.2.9/include -I/root/installs/php/php-5.2.9/main -I/root/installs/php/php-5.2.9 -I/opt/iplanet/current/include -I/opt/iplanet/current/plugins/include -I/usr/include/libxml2 -I/rot/installs/php/php-5.2.9/ext/date/lib -I/usr/include/mysql -I/root/installs/php/php-5.2.9/TSRM -I/root/installs/php/php-5.2.9/Zend  -D_REENTRANT -DTHREAD=1  -I/usr/include -g -O2 -pthread -DZTS  -refer-non-pic -c /root/installs/php/php-5.2.9/Zend/zend_default_classes.c -o Zend/zend_default_classes.lo
    /bin/sh /root/installs/php/php-5.2.9/libtool silent preserve-dup-deps --mode=compile /root/installs/php/php-5.2.9/meta_ccld  -IZend/ -I/root/installs/php/php-5.2.9/Zend/ -DPHP_ATOM_INC -I/rootinstalls/php/php-5.2.9/include -I/root/installs/php/php-5.2.9/main -I/root/installs/php/php-5.2.9 -I/opt/iplanet/current/include -I/opt/iplanet/current/plugins/include -I/usr/include/libxml2 -I/rot/installs/php/php-5.2.9/ext/date/lib -I/usr/include/mysql -I/root/installs/php/php-5.2.9/TSRM -I/root/installs/php/php-5.2.9/Zend  -D_REENTRANT -DTHREAD=1  -I/usr/include -g -O2 -pthread -DZTS  -refer-non-pic -c /root/installs/php/php-5.2.9/Zend/zend_execute.c -o Zend/zend_execute.lo
    /bin/sh /root/installs/php/php-5.2.9/libtool silent preserve-dup-deps --mode=compile /root/installs/php/php-5.2.9/meta_ccld  -Isapi/nsapi/ -I/root/installs/php/php-5.2.9/sapi/nsapi/ -DPHP_ATOMINC -I/root/installs/php/php-5.2.9/include -I/root/installs/php/php-5.2.9/main -I/root/installs/php/php-5.2.9 -I/opt/iplanet/current/include -I/opt/iplanet/current/plugins/include -I/usr/include/lbxml2 -I/root/installs/php/php-5.2.9/ext/date/lib -I/usr/include/mysql -I/root/installs/php/php-5.2.9/TSRM -I/root/installs/php/php-5.2.9/Zend  -D_REENTRANT -DTHREAD=1  -I/usr/include -g -O2 -pthrad -DZTS  -prefer-non-pic -c /root/installs/php/php-5.2.9/sapi/nsapi/nsapi.c -o sapi/nsapi/nsapi.lo
    /root/installs/php/php-5.2.9/sapi/nsapi/nsapi.c:62:19: error: nsapi.h: No such file or directory
    /root/installs/php/php-5.2.9/sapi/nsapi/nsapi.c:81: error: expected specifier-qualifier-list before 'pblock'
    /root/installs/php/php-5.2.9/sapi/nsapi/nsapi.c: In function 'nsapi_strdup':
    /root/installs/php/php-5.2.9/sapi/nsapi/nsapi.c:130: warning: return makes pointer from integer without a cast
    /root/installs/php/php-5.2.9/sapi/nsapi/nsapi.c: At top level:
    /root/installs/php/php-5.2.9/sapi/nsapi/nsapi.c:206: error: expected ')' before '*' token
    /root/installs/php/php-5.2.9/sapi/nsapi/nsapi.c:207: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'nsapi_servact_uri2path'
    /root/installs/php/php-5.2.9/sapi/nsapi/nsapi.c:208: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'nsapi_servact_pathchecks'
    /root/installs/php/php-5.2.9/sapi/nsapi/nsapi.c:209: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'nsapi_servact_fileinfo'
    /root/installs/php/php-5.2.9/sapi/nsapi/nsapi.c:210: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'nsapi_servact_service'
    /root/installs/php/php-5.2.9/sapi/nsapi/nsapi.c: In function 'php_nsapi_init_dynamic_symbols':
    /root/installs/php/php-5.2.9/sapi/nsapi/nsapi.c:250: error: 'nsapi_servact_uri2path' undeclared (first use in this function)
    /root/installs/php/php-5.2.9/sapi/nsapi/nsapi.c:250: error: (Each undeclared identifier is reported only once
    /root/installs/php/php-5.2.9/sapi/nsapi/nsapi.c:250: error: for each function it appears in.)
    /root/installs/php/php-5.2.9/sapi/nsapi/nsapi.c:250: error: 'nsapi_servact_prototype' undeclared (first use in this function)
    /root/installs/php/php-5.2.9/sapi/nsapi/nsapi.c:250: error: expected ';' before 'dlsym'
    /root/installs/php/php-5.2.9/sapi/nsapi/nsapi.c:251: error: 'nsapi_servact_pathchecks' undeclared (first use in this function)
    /root/installs/php/php-5.2.9/sapi/nsapi/nsapi.c:251: error: expected ';' before 'dlsym'
    /root/installs/php/php-5.2.9/sapi/nsapi/nsapi.c:252: error: 'nsapi_servact_fileinfo' undeclared (first use in this function)
    /root/installs/php/php-5.2.9/sapi/nsapi/nsapi.c:252: error: expected ';' before 'dlsym'
    /root/installs/php/php-5.2.9/sapi/nsapi/nsapi.c:253: error: 'nsapi_servact_service' undeclared (first use in this function)
    /root/installs/php/php-5.2.9/sapi/nsapi/nsapi.c:253: error: expected ';' before 'dlsym'
    /root/installs/php/php-5.2.9/sapi/nsapi/nsapi.c: In function 'zm_info_nsapi':
    /root/installs/php/php-5.2.9/sapi/nsapi/nsapi.c:300: error: 'nsapi_servact_service' undeclared (first use in this function)
    /root/installs/php/php-5.2.9/sapi/nsapi/nsapi.c: In function 'zif_nsapi_virtual':
    /root/installs/php/php-5.2.9/sapi/nsapi/nsapi.c:318: error: 'Request' undeclared (first use in this function)
    /root/installs/php/php-5.2.9/sapi/nsapi/nsapi.c:318: error: 'rq' undeclared (first use in this function)
    make: *** [sapi/nsapi/nsapi.lo] Error 1

    assuming you have installed web server 7 under /opt/iplanet/current (by choosing /opt/iplanet/current) within web server 7 installer, then php 5.2.9 installation along with its nsapi plugin should go through fine by doing
    ./configure --with-nsapi=/opt/iplanet/current
    you can verify this by looking for /opt/iplanet/current/include/nsapi.h . if you didn't find there, then you web server 7 installation did not go through successfully.
    on a side note, you might always want to use the gd that bundles within php. for example, enabling this directive causes php to use the bundled gd
    '--enable-gd-jis-conv' '--enable-gd-native-ttf'
    otherwise you will run into weird issues.

  • Runtime exec createProcess error

    Seeveral monts ago I get this piece of code on ee
    It gets hard disk numer via cmd.exe
    that works fine on xp but on 98 dont because there is no cmd.exe :)
    My coworker make little exe fajl (hdid.exe) which return id number and it works fine too on xp but on 98 that piece of code throws io exception
    Here is the function I use for it
    (lines under comments are lines that I have used before new hdid.exe )
    public String getKey(){
    try {
    System.out.println("check gk 0 ");
    String[] args = new String[] { KlijentPutanje.getRoot()+"/hdid.exe" };
    //String[] args = new String[] { "cmd.exe",  "/c",  "dir", "|",  "find", "/i",  "Serial Number is" };
    Process pro = Runtime.getRuntime().exec(args);
    InputStream error = pro.getErrorStream();
    InputStream output = pro.getInputStream();
    collector = new StringBuffer();
    ProcessStreamReader collectingReader = new ProcessStreamReader(output);
    Thread out = new Thread(collectingReader);
    out.start();
    out.join();
    String volumeNumber = collector.toString();
    //volumeNumber = volumeNumber.substring(volumeNumber.lastIndexOf(' '));
    volumeNumber = volumeNumber.trim();
    return volumeNumber;
    catch (Exception e){
    System.out.println("greska prilikom provere registracije - code 169");
    e.printStackTrace();
    return null;
    Here is the exception that this line throws
    greska prilikom provere registracije - code 169
    java.io.IOException: CreateProcess:
    /Grom/dev/pilot/1.0-radna/Ekspert/EkspertData/hdid.exe error=0
    at java.lang.Win32Process.create(Native Method)
    at java.lang.Win32Process.<init>(Unknown Source)
    at java.lang.Runtime.execInternal(Native Method)
    at java.lang.Runtime.exec(Unknown Source)
    at java.lang.Runtime.exec(Unknown Source)
    at java.lang.Runtime.exec(Unknown Source)
    at com.propisi.util.Reg.getKey(Reg.java:280)
    at com.propisi.util.Reg.execute(Reg.java:73)
    at com.propisi.SearchEngine.getSearchEngine(SearchEngine.java:130)
    at com.propisi.forme.AppletPretraga.loadReg(AppletPretraga.java:574)
    at com.propisi.forme.AppletPretraga.jbInit(AppletPretraga.java:235)
    at com.propisi.forme.AppletPretraga.init(AppletPretraga.java:167)
    at sun.applet.AppletPanel.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
    Can you help me 2 get hard disk number on windows98 too (with this hdid.exe pr maybe some other way)
    tia cubrovic

    That does look like a problem with you coworker's native code, not like a Java problem.

  • Tidal abends with error message: Jvm call Runtime.exec() returned null

    just wandering if this error "Jvm call Runtime.exec() returned null  Command[chmod 777] launch failed." is a tidal error and not a job command error returned from the OS server.
    thanks,
    warren

    I'm having the same problem...
    Have you been able to solve your problem yet?

  • Intermittent Error with Runtime.exec()

    I have a Windows Service for an Adaptive Server Anywhere database server that is built upon install of our application.
    One of the new things we're trying to do with our app
    requires us to shutdown this service using Java (1.4.2_06) code. This
    shutdown is done by using the runtime.exec("dbsvc -x
    ASA_SERVICE") command. Sometimes this works fine, but
    others it fails. I got the error output from the java
    command which is: Overlapped I/O operation is in progress.
    Error stopping service "ASA_SERVICE". When I try and
    shutdown the service via the Windows Service dialog I have
    no problems anytime. I see no errors in the ASA log
    file. Can someone tell me what might be
    causing the error sometimes when running this using the Java
    runtime.exec(...) command?
    Thanks,
    Cory Musselman

    Try running the command a couple of dozen times from the command line, not from Runtime.exec() but just from a plain old command line. That should give you a better idea of whether Runtime.exec() is part of the problem or not.

  • Process core dumps when spawned by Runtime.exec()

    I am using a Runtime.exec() command to spawn a local executable process on HP-UX. The local process (C++ executable) starts and is functional, though at a certain point during operation, the process creates a segmentation fault and core dumps. If the same process is spawned manully from a shell, this does not occur.
    The process cores at the same point every time (a call to free+ in the system libC library). I have duplicated as much of my shell environment in the Runtime.exec() call as possible. Also, this issue does not occur on AIX or Linux (ports of my code to those platforms).
    What is the fundimental difference between spawning a process from a shell V.S. the JVM spawning the process that could cause this difference in behavior?
    java version "1.4.2.07"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2.07-050121-15:53)
    Java HotSpot(TM) Server VM (build 1.4.2 1.4.2.07-050121-17:30-PA_RISC2.0 PA2.0 (aCC_AP), mixed mode)

    We are currently having the same problem, it is killing us.
    We have upgraded to jdk 1.6u16 and still have the problem.
    We think it is related to sparc platform we had been running for some time with same code on X86 server
    Our solaris release is: Solaris 10 11/06 s10s_u3wos_10 SPARC
    We can't get a reproducible small test case. It is getting us most often when the JVM running our
    appserver uses the Runtime.getRuntime().exec(cmd);
    We are jumping through hoops looking for workaround. We are trying to write a command server that can
    have the command sent through a socket and have all the ouput sent back over the same socket.
    That way the app server JVM is not the one doing the fork and exec.

  • Runtime.exec category registry error

    I am calling runtime.exec() to start an application on a different machine than the one running my java application. my code is:
    runtime.exec("\"\\\\computername\\sharedfolder\\executable.exe\"");
    it compiles fine, but i get a pop-up window with the title "InitCategoryRegistry" that says "Couldnt create category registry"
    Does anyone know how to get this to work?

    Try removing the \" at the front and the rear of your String argument, as well as using Runtime.getRuntime().exec(String command)
    like thus:
    Runtime.getRuntime().exec("\\\\computername\\sharedfolder\\executable.exe");
    Hope it works

Maybe you are looking for