Saturday, August 23, 2008

RMI & NetBeans IDE


Hi everyone,


I'm sure there are a still quite a few people out there who are interested in how to start RMI in NetBeans. Although the demand for RMI support has been decreasing lately, this doesn't mean that it has completely disappeared. And with just a little tweaking, you can start the RMI registry in NetBeans very easily. Assuming you've already created RMIClient and RMIServer classes, do the following:


  1. 1. In your open project, go to the Files window.

  2. 2. Open the build.xml file in the Source Editor.

  3. 3. Paste the following Ant Script into the build.xml file:


    <target name="startRMI" depends="init">
    <exec executable="rmiregistry" dir="${build.classes.dir}">
    </exec>
    </target>



  4. 4. To start the registry, right-click the build.xml file, then select Run Target > Other Targets > StartRMI.

  5. 5. The Output window should display the result.

  6. 6. Run your RMIServer file. In the Output window, it should be displayed as "bound in server."

  7. 7. Run your RMIClient file, and watch it go.


See you tommorrow. Cheers!


--James

9 comments:

Prakash said...

Thank you.... !
it's working nice.

Unknown said...

Sweet, this works!

Annya said...

Thank you for the tip!
But for me it is not working
It says file not found in the specified loaction.Do I have to download/copy rmiregistry file to build.classes.Where do i find the file?
Thanks
Anisha

vamos said...

Works ...Thanks

maya said...

it is not working
It says file not found in the specified loaction.Do I have to download/copy rmiregistry file to build.classes.Where do i find the file?

Bueno said...

Thank you.... !

Swati Rohilla said...

Hello Sir,

I m using netbeans 7.0 i have pasted your code but there is no option of startRMI is appearing while running this file.

Please help me.
Please leave a message to me at swatirohela@gmail.com
Swati

Beril said...

Cool, Just go to 'projects' tab and select our project and right click it, then select 'Clean and Build', Now it will generate what you need..

RS said...

This is very Ambiguous Steps you mentioned.

Can you please tell me how do i see build.xml file in Netbeans PROJECT Window??

Please don't copy paste...i saw this yet another website where the same unclear steps were mentioned.