JSR 308 javap README

Version ? (?)

This document describes how to obtain and use a version of the javap class disassembler that has been modified to parse and display both JSR 175 and JSR 308 annotations.

Contents:

Introduction

“JSR 308 javap” is a modification of the OpenJDK 7 javap class disassembler that can display information about annotations. The unmodified javap tool displays hexadecimal dumps of each attribute in a class file that it does not recognize, including the attributes that contain annotations. JSR 308 javap parses annotation-containing attributes as specified by JSRs 175 and 308. It displays the types and arguments for both kinds of annotations, and additionally displays the internal fields of JSR 308 annotations as specified in Section 4 of the JSR 308 proposal.

The "Building the compiler" section below contains instructions for building and running the JSR 308 javap tool.

Building and running the JSR 308 javap tool

The following steps will create an executable jar file for running the javap tool.

  1. Obtain and build the JSR 308 Java compiler.
  2. TODO: the javac.jar library might also need to be added to the $CLASSPATH -- Matt must test this before making a release! -MP
  3. Compile only the JSR 308 javap tool, by running ant in directory openjdk/j2se/src/share/opensource/javap .
  4. Run javap using the following command:
        java -jar openjdk/j2se/src/share/opensource/javap/javap.jar
    
    Alternatively, you may add openjdk/j2se/src/share/opensource/javap/javap.jar to the front of your CLASSPATH environment variable and use:
        java sun.tools.javap.Main
    

JSR 308 webpage