Results 1 to 14 of 14
  1. #1
    qwerty321 is offline Member
    Join Date
    Oct 2010
    Posts
    6
    Rep Power
    0

    Default byte code viewer

    hello there
    I am new to java never used it before and really need help
    I downloaded eclipse and jdk

    My assignment is this:

    create a simple Java bytecode viewer that analyzes Java bytecode in .class java files and outputs the main components of the respective .class file and their properties. Your Java program should allow a user to specify a class file and view the following:
    1) Information about the input .class file such as its name, the Java source file it is compiled from, the compiler version, number of entries in the constant pool, etc.
    2) A list of the class fields as declared in the Java source file
    3) A list of the class internal attributes.
    4) The list of the class methods, their respective bytecode representation, and the set of internal attributes for each one of them.
    ***Make sure that your application is esthetically appealing, e.g., use tabs or a tree control etc.***
    ***For each entity from the class file you display also provide a description of it that you could extract from a JVM reference or use your own words to describe it***
    Your bytecode viewer should be GUI based.

    I don't need the solution..can someone guide me please
    and another question: is the swing package included in eclipse or i need to download it?

    thank you

  2. #2
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,000
    Blog Entries
    7
    Rep Power
    20

    Default

    If you're completely new to Java tell your teacher/professor that this assignment is way over your head; don't go there.

    kind regards,

    Jos

  3. #3
    qwerty321 is offline Member
    Join Date
    Oct 2010
    Posts
    6
    Rep Power
    0

    Default

    i wish i could:/
    maybe u can try and help me by answerin my question:
    suppose i have the code..i need to use the swing package in eclipse
    how do i do that?
    do i need to download the package?
    or i need to download visual editor?
    i have no idea

  4. #4
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,000
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by qwerty321 View Post
    i wish i could:/
    maybe u can try and help me by answerin my question:
    suppose i have the code..i need to use the swing package in eclipse
    how do i do that?
    do i need to download the package?
    or i need to download visual editor?
    i have no idea
    Swing comes bundled with your Java SE JRE download so you can simply use it in Eclipse; no other downloads are needed.

    kind regards,

    Jos

  5. #5
    qwerty321 is offline Member
    Join Date
    Oct 2010
    Posts
    6
    Rep Power
    0

    Default

    but how can i use it in eclipse
    i need to write a command in the import part? sthg like this right?

  6. #6
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,000
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by qwerty321 View Post
    but how can i use it in eclipse
    i need to write a command in the import part? sthg like this right?
    You have to import the classes you want to use, just as you have to do with every class you want to use (except for the classes in the java.lang package). This has nothing to do with Swing although it can help you with it (press Ctrl-Shift-O to organize your imports).

    kind regards,

    Jos

  7. #7
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,450
    Rep Power
    18

    Default

    You're new to Java?
    And they want you to analyse a .class file?
    And display the results in Swing?

    Neither of those is a start point for Java...I despair sometimes.

  8. #8
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,000
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by Tolls View Post
    You're new to Java?
    And they want you to analyse a .class file?
    And display the results in Swing?

    Neither of those is a start point for Java...I despair sometimes.
    I told the OP the same thing; this project is going to fail miserably and leaves the OP behind very disappointed.

    kind regards,

    Jos

  9. #9
    masijade is offline Senior Member
    Join Date
    Jun 2008
    Posts
    2,571
    Rep Power
    8

    Default

    Are you suppossed to "analyse" the file, or are you simply to execute javap on the class file and display those results? As that what you describe javap already does.

  10. #10
    qwerty321 is offline Member
    Join Date
    Oct 2010
    Posts
    6
    Rep Power
    0

    Default

    You would probably need to use the Byte Code Engineering Library (BCEL) which contains high-level Java programming constructs based on a variant of the Java Reflection API that can be used to analyze Java bytecode and extract useful information about their constituents. Note that BCEL has a bunch of bytecode editing functionality that allows the dynamic editing, creation, and injection of bytecode instruction. For simplifying your task, your code is only required to browse the bytecode contents and not to edit or modify it


    That what is said in the assignment so i think i need to dispaly the analysis

    Please can you guide me?

  11. #11
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,450
    Rep Power
    18

    Default

    ???

    Are you sure you're on the right course?

  12. #12
    qwerty321 is offline Member
    Join Date
    Oct 2010
    Posts
    6
    Rep Power
    0

    Default

    please i need help here!

  13. #13
    qwerty321 is offline Member
    Join Date
    Oct 2010
    Posts
    6
    Rep Power
    0

    Default

    i need to use the Class2HTML utility no?

  14. #14
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,450
    Rep Power
    18

    Default

    Swing is part of the base JavaSE, so nothing to download there.
    BCEL is from Apache, so you'll have to get hold of that.
    No idea what Class2HTML is.

Similar Threads

  1. Replies: 1
    Last Post: 04-21-2010, 02:28 AM
  2. image to byte code file conversion
    By nupurashi in forum Java Tip
    Replies: 0
    Last Post: 01-28-2009, 10:25 AM
  3. A simple Java source code viewer
    By Java Tip in forum SWT
    Replies: 0
    Last Post: 07-11-2008, 04:34 PM

Posting Permissions

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