×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Mar 2003
    Location
    United Kingdom
    Posts
    49

    Viewing Bytecode?

    Hi,

    Does anyone know of a way to get the Java compiler to generate a text file that contains the byte code instructions so that I can view how the compiler is compiling my code? A bit like C / C++ compilers will generate an ASM outpout file. Or failing that, some kind of tool that will allow me to do this.

    Thanks

    Mat

  2. #2
    Super Contributor
    Join Date
    Mar 2003
    Location
    Israel
    Posts
    2,280
    You could always compile and then decompile (here's a list of decompilers, I like DJ the best) your code.
    The java SDK has a profiling tool called javap that might help you out a bit. I learned about it in a couple of other threads here:
    http://nkn.forum.nokia.com/forum/sho...ht=%2Ajavap%2A
    http://nkn.forum.nokia.com/forum/sho...ht=%2Ajavap%2A
    Other than that Google is your friend.

    shmoove

  3. #3
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395
    The Sun JDK comes with a utility program called javap, which is used to dump the contents of a class. Optionally, it can display a disassembled output.
    Code:
    javap -bootclasspath \wtk\lib\midpapi.jar -private -c MyClass
    or use the -? command line option to get a full list of options.

    Graham.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •