Article View: borland.public.jbuilder.java.api
Article #1983Re: How to get the process Id?
From: Justin Fowler
Date: Tue, 19 Jun 2001 13:10
Date: Tue, 19 Jun 2001 13:10
25 lines
1860 bytes
1860 bytes
Getting a process ID is specific to the platform, in which you are running
java on. What you will need to do is use a java native call to C++, which
can make a call to OS.
This can be accomplished through JNI. (Java Native Interface).
Cheers
Justin
"Fred" <frederic.malabre@lunalogic.com> wrote in message
news:5RpT6.4766$Tk1.6436999@nnrp4.proxad.net...
> Hi,
>
> I would like to get the process Id. Is there a way to do that in Java? I
> can't find any...
>
> If not, how can I get a unique number representing a process on a machine.
>
> The idea is to launch several same programs on a machine, and following a
> broadcast message, the programs keep the message corresponding to their
> process.
>
> Thanks,
> Fred.
>
>
Technical Details
Message-ID:
<nbIX6.143590$ff.1093030@news-server.bigpond.net.au>Path:
arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!nntp-relay.ihug.net!ihug.co.nz!news.stealth.net!intgwpad.nntp.telstra.net!news-server.bigpond.net.au!not-for-mailReferences:
<5RpT6.4766$Tk1.6436999@nnrp4.proxad.net>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1089d0,ed42b38ef2866f51 X-Google-Attributes: gid1089d0,public X-Google-ArrivalTime: 2001-06-19 06:10:44 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!nntp-relay.ihug.net!ihug.co.nz!news.stealth.net!intgwpad.nntp.telstra.net!news-server.bigpond.net.au!not-for-mail From: "Justin Fowler" <jfowler1@bigpond.net.au> Newsgroups: borland.public.jbuilder.java.api References: <5RpT6.4766$Tk1.6436999@nnrp4.proxad.net> Subject: Re: How to get the process Id? Lines: 27 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.3018.1300 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.3018.1300 Message-ID: <nbIX6.143590$ff.1093030@news-server.bigpond.net.au> Date: Tue, 19 Jun 2001 13:10:43 GMT NNTP-Posting-Host: 144.132.100.162 X-Complaints-To: news@bigpond.net.au X-Trace: news-server.bigpond.net.au 992956243 144.132.100.162 (Tue, 19 Jun 2001 23:10:43 EST) NNTP-Posting-Date: Tue, 19 Jun 2001 23:10:43 EST Organization: BigPond Internet Services (http://www.bigpond.net.au)