java left logo
java middle logo
java right logo
 

Home arrow Other API Tips
 
 
Main Menu
Home
Java Tutorials
Book Reviews
Java SE Tips
Java ME Tips
Java EE Tips
Other API Tips
Java Applications
Java Libraries
Java Games
Java Network
Java Forums
Java Blog




Most Visited Tips
Java SE Tips
Java ME Tips
Java EE Tips
Other API Tips
Java Applications
Java Libraries
Java Games
Book Reviews
Top Rated Tips
Java SE Tips
Java ME Tips
Java EE Tips
Other API Tips
Java Applications
Java Libraries
Java Games
Book Reviews


Statistics
Registered Users: 4089
Java SE Tips: 614
Java ME Tips: 202
Java EE Tips: 183
Other API Tips: 779
Java Applications: 298
Java Libraries: 209
Java Games: 16
Book Reviews:
 
 
 
How to use Rmic task E-mail
User Rating: / 8
PoorBest 

Rmic

Description

Runs the rmic compiler for a certain class.

Rmic can be run on a single class (as specified with the classname attribute) or a number of classes at once (all classes below base that are neither _Stub nor _Skel classes). If you want to rmic a single class and this class is a class nested into another class, you have to specify the classname in the form Outer$$Inner instead of Outer.Inner.

It is possible to refine the set of files that are being rmiced. This can be done with the includes, includesfile, excludes, excludesfile and defaultexcludes attributes. With the includes or includesfile attribute you specify the files you want to have included by using patterns. The exclude or excludesfile attribute is used to specify the files you want to have excluded. This is also done with patterns. And finally with the defaultexcludes attribute, you can specify whether you want to use default exclusions or not. See the section on directory based tasks, on how the inclusion/exclusion of files works, and how to write patterns.

This task forms an implicit FileSet and supports all attributes of <fileset> (dir becomes base) as well as the nested <include>, <exclude> and <patternset> elements.

It is possible to use different compilers. This can be selected with the "build.rmic" property or the compiler attribute. There are three choices:

  • sun (the standard compiler of the JDK)
  • kaffe (the standard compiler of Kaffe)
  • weblogic

The miniRMI project contains a compiler implementation for this task as well, please consult miniRMI's documentation to learn how to use it.

Parameters

Attribute Description Required
base the location to store the compiled files. Yes
classname the class for which to run rmic. No
filtering indicates whether token filtering should take place No
sourcebase Pass the "-keepgenerated" flag to rmic and move the generated source file to the given sourcebase directory. No
stubversion Specify the JDK version for the generated stub code. Specify "1.1" to pass the "-v1.1" option to rmic. No
classpath The classpath to use during compilation No
classpathref The classpath to use during compilation, given as reference to a PATH defined elsewhere No
includes comma- or space-separated list of patterns of files that must be included. All files are included when omitted. No
includesfile the name of a file. Each line of this file is taken to be an include pattern No
excludes comma- or space-separated list of patterns of files that must be excluded. No files (except default excludes) are excluded when omitted. No
excludesfile the name of a file. Each line of this file is taken to be an exclude pattern No
defaultexcludes indicates whether default excludes should be used or not ("yes"/"no"). Default excludes are used when omitted. No
verify check that classes implement Remote before handing them to rmic (default is false) No
iiop indicates that portable (RMI/IIOP) stubs should be generated No
iiopopts additional arguments for IIOP class generation No
idl indicates that IDL output files should be generated No
idlopts additional arguments for IDL file generation No
debug generate debug info (passes -g to rmic). Defaults to false. No
includeAntRuntime whether to include the Ant run-time libraries; defaults to yes. No
includeJavaRuntime whether to include the default run-time libraries from the executing VM; defaults to no. No
extdirs location of installed extensions. No
compiler The compiler implementation to use. If this attribute is not set, the value of the build.rmic property, if set, will be used. Otherwise, the default compiler for the current VM will be used. (See the above list of valid compilers.) No

Parameters specified as nested elements

classpath and extdirs

Rmic's classpath and extdirs attributes are PATH like structure and can also be set via a nested classpath and extdirs elements.

compilerarg

You can specify additional command line arguments for the compiler with nested <compilerarg> elements. These elements are specified like Command-line Arguments but have an additional attribute that can be used to enable arguments only if a given compiler implementation will be used.

Attribute Description Required
value See Command-line Arguments. Exactly one of these.
line
file
path
compiler Only pass the specified argument if the chosen compiler implementation matches the value of this attribute. Legal values are the same as those in the above list of valid compilers.) No

Examples

  <rmic classname="com.xyz.FooBar" base="${build}/classes"/>

runs the rmic compiler for the class com.xyz.FooBar. The compiled files will be stored in the directory ${build}/classes.

  <rmic base="${build}/classes" includes="**/Remote*.class"/>

runs the rmic compiler for all classes with .class files below ${build}/classes whose classname starts with Remote. The compiled files will be stored in the directory ${build}/classes.

Source: Apache Ant


 Related Tips

 
< Prev   Next >

Page 1 of 0 ( 0 comments )

You can share your information about this topic using the form below!

Please do not post your questions with this form! Thanks.


Name (required)


E-Mail (required)

Your email will not be displayed on the site - only to our administrator
Homepage(optional)



Comment Enable HTML code : Yes No



 
       
         
     
 
 
 
   
 
 
java bottom left
java bottom middle
java bottom right
RSS 0.91 FeedRSS 1.0 FeedRSS 2.0 FeedATOM FeedOPML Feed

Home - About Us - Privacy Policy
Copyright 2005 - 2008 www.java-tips.org
Java is a trademark of Sun Microsystems, Inc.