How to get the process id after running an application from Java under Linux

Use the following sample code to get the pid(process id) on *nix variants, after running it as a command from Java using Runtime.exec() .

The command variable, in my case, was running another Java application.

try {

Process  process=Runtime.getRuntime().exec(new String [] {"sh","-c",command+"  &  echo $!"} );
BufferedReader br=new BufferedReader(new InputStreamReader(process.getInputStream()));

String ps=br.readLine();
int pid=Integer.valueOf(ps);
} catch (IOException e2) {
// TODO Auto-generated catch block
e2.printStackTrace();
}

Get the 200$ MindMap program for free!!

Ok, I haven’t actually tried it yet;(I’m downloading it right now) but it seemed a good enough deal to let you know about this.

"ConceptDraw MINDMAP is business and personal productivity software that combines the most commonly used methods of listing and organizing information within single productivity toolbox:

Read the rest of this entry »

Blog Writer Desktop Application

Hello there!

I just started trying the Windows Live Writer application to write to this blog. Since it seems that this particular start to write blog posts will not end as my earlier tryouts;(it always came to an end after 4-5 posts before :( )  I thought I could need the flexibility of a desktop application. When you add an image file; it automatically uploads it to your blog’s server or an ftp server of your choice.

WL Writer

It seems good enough right now; so I will be using this application for some time. Though I am sure that there are many other applications like this on the internet. Know of any portable, feature-rich application that does this job? Drop a comment or two if you do.

C ya!