It is possible. If you want to use static stubs, you can use the Ant task ; for example, in a plain Java project you can add to build.xml something like this:

<target name="-post-compile">
    <rmic base="${build.classes.dir}" includes="**/*Impl.class"/>
</target>

To use dynamic stubs available in JDK 5, see

http://java.sun.com/j2se/1.5.0/docs/relnotes/features.html#rmi

Source: NetBeans User FAQ