Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

[LITTLE LONG] runtime.exec can't launch link.exe (the linker of windows)

807591Jun 1 2008 — edited Jun 2 2008
hi all

I try to launch , in a directory this two command, link.exe (the linker of windows).

so there my class
import java.io.IOException;


public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		ProcessLauncher proc = new ProcessLauncher();
		try {
			proc.setOutputStream(System.out);
			proc.setErrorStream(System.err);
			String link = "link";
			String arg[]= {link};
			int exitVal = proc.exec(arg,null);
		       System.out.println("Process exitValue: " + exitVal);
			System.out.println(arg[0]);
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

}
for poeple who wanna know, http://ydisanto.ftp-developpez.com/tutoriels/j2se/runtime/fichiers/ProcessLauncher.java is the class of process launcher (founded on a other site, this class work perfecly and are tested.

the funny thing is if I replace link by echo hello world or any other thing, it"s work and exit value is 0 (so it's good).

but with link or link.exe or C:\... \VB\bin\link.exe (the absolute path) or cmd.exe /C link.exe, etc...etc..

I just have nothing and the exit value is negatif, there is the output

Process exitValue: -1073741515
link

and I have no idea why , really. I have exacly the same probleme with cl.exe
techincly I must have

{code}
c:\yafl\YDbUpdate>link
Microsoft (R) Incremental Linker Version 8.00.50727.42
Copyright (C) Microsoft Corporation. All rights reserved.

usage: LINK [options] [files] [@commandfile]

options:
etc...
etc...
{code}


And I just catch nothing.

So any help would be good and if someone can try this on his computer and say if he have the same problem.

thanks

a+++
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 30 2008
Added on Jun 1 2008
4 comments
177 views