sun.rmi.rmic.Main - "rmic" Command

Q

How to run "rmic" command from JDK tools.jar file?

✍: FYIcenter

A

"rmic" command allows you to run the RMI (Remote Method Invocation) compiler.

"rmic" command is supported by the lib\tools.jar JAR file JDK 1, 2, 3, 4, 5, 6, 7, and 8.

You can run the "rmic" command using the JDK tools.jar file as described below using JDK 8 as an example:

fyicenter> set JDK_HOME=\fyicenter\jdk-1.8.0_191

fyicenter> %JDK_HOME%\bin\java -cp %JDK_HOME%\lib\tools.jar sun.rmi.rmic.Main

Usage: rmic <options> <class names>

where <options> includes:
  -keep          Do not delete intermediate generated source files
  -keepgenerated (same as "-keep")
  -v1.1          Create stubs/skeletons for 1.1 stub protocol version (deprecate
d)
  -vcompat       Create stubs/skeletons compatible with both
                           1.1 and 1.2 stub protocol versions (deprecated)
  -v1.2          (default) Create stubs for 1.2 stub protocol version only (depr
ecated)
  -iiop          Create stubs for IIOP. When present, <options> also includes:

                   -always           Create stubs even when they appear current
                   -alwaysgenerate   (same as "-always")
                   -nolocalstubs     Do not create stubs optimized for same proc
ess

  -idl           Create IDL. When present, <options> also includes:

                   -noValueMethods   Do not generate methods for valuetypes
                   -always           Create IDL even when it appears current
                   -alwaysgenerate   (same as "-always")

  -g             Generate debugging info
  -nowarn        Generate no warnings
  -nowrite       Do not write compiled classes to the file system
  -verbose       Output messages about what the compiler is doing
  -classpath <path>      Specify where to find input class files
  -bootclasspath <path>  Override location of bootstrap class files
  -extdirs <path>        Override location of installed extensions
  -d <directory>         Specify where to place generated class files
  -J<runtime flag>       Pass argument to the java interpreter

 

Tools Supported from JRE JAR Files

sun.applet.Main - "appletviewer" Command

Tools Supported from JDK 8- JAR Files

⇑⇑ FAQ for JDK (Java Development Kit)

2019-10-26, 2255🔥, 0💬