Results 1 to 8 of 8
- 02-17-2012, 07:14 AM #1
Member
- Join Date
- Oct 2011
- Posts
- 6
- Rep Power
- 0
affinity setting and jar launching in linux.
Hi all,
I'm trying to launch a jar as a process in linux and at the same time trying to set the affinity of the process.
I'm able to do it in windows in the following codes. However, I'm not sure how do to it in linux.
Runtime r = Runtime.getRuntime();
Process p = null;
String s = "cmd.exe /c start /affinity " + affinity + " java -jar \"myJar.jar\"";
p = control.r.exec(s);
- 02-17-2012, 02:36 PM #2
Member
- Join Date
- May 2011
- Posts
- 27
- Rep Power
- 0
Re: affinity setting and jar launching in linux.
no need to use the cmd.exe just use the "cmd /c start /affinity " + affinity + " java -jar \"myJar.jar\"";
p = Runtime.getRuntime().exce(s) or r.exec(s);
I think it will help you.
- 02-17-2012, 02:47 PM #3
Re: affinity setting and jar launching in linux.
@dinesh.guntha
What does the OS do differently if you use the cmd.exe command vs the cmd command? What extension does the OS add to a "command" to find the file to be executed?
Is there a command named cmd on linux?
- 02-17-2012, 02:53 PM #4
Member
- Join Date
- May 2011
- Posts
- 27
- Rep Power
- 0
Re: affinity setting and jar launching in linux.
nothing difference is ther but i tryed by using cmd.exe it was not working. so that i used with cmd it was working fine.
In the above code he is using the control.r.exec(s).
what is the "control"?
That also may be a case that it is not able to execute.
- 02-17-2012, 03:27 PM #5
- 02-18-2012, 09:19 AM #6
Member
- Join Date
- Oct 2011
- Posts
- 6
- Rep Power
- 0
Re: affinity setting and jar launching in linux.
Runtime r = Runtime.getRuntime();
Process p = null;
String s = "cmd.exe /c start /affinity " + affinity + " java -jar \"myJar.jar\"";
p = r.exec(s);
sorry for the confusion. control is the class which I had declared r.
- 02-18-2012, 09:20 AM #7
Member
- Join Date
- Oct 2011
- Posts
- 6
- Rep Power
- 0
- 02-18-2012, 04:58 PM #8
Re: affinity setting and jar launching in linux.
Get in the habit of using standard Java naming conventions!
Similar Threads
-
Launching an exe
By kanupriya in forum New To JavaReplies: 19Last Post: 01-19-2011, 10:24 AM -
How to setting a best environment for java programming under linux
By huasen in forum New To JavaReplies: 11Last Post: 12-12-2010, 06:27 AM -
setting the "Java classes" directory in Linux
By mr_anderson in forum Advanced JavaReplies: 1Last Post: 08-02-2010, 07:18 AM -
[SOLVED] Windows Linux conflict - TrayIcon image not display in Linux
By Eranga in forum Advanced JavaReplies: 6Last Post: 04-08-2009, 04:05 AM -
Setting path under Linux to recognize jre
By cccccc in forum New To JavaReplies: 4Last Post: 03-31-2009, 06:51 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks