Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8493833
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T23:07:49+00:00 2026-06-10T23:07:49+00:00

//bytecode of <init> 0: aload_0 1: invokespecial java.lang.Object.<init> ()V (8) 4: return //bytecode of

  • 0
//bytecode of <init>
0:    aload_0
1:    invokespecial java.lang.Object.<init> ()V (8)
4:    return
//bytecode of <main>
0:    getstatic     java.lang.System.out Ljava/io/PrintStream; (16)
3:    ldc       "Hello World" (22)
5:    invokevirtual java.io.PrintStream.println (Ljava/lang/String;)V (24)
8:    return

The above is the byte code for :

public class Hi {
  public static void main(String[] args) {
    System.out.println("Hello World");
  }
}

If I have only the byte code, how do I run it? Can I? And what’s the extention of the byte code file? Hi.class?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T23:07:50+00:00Added an answer on June 10, 2026 at 11:07 pm

    You can compile byte code using Jasmin which has its own format. You need the byte code for the entire class, not just the body of a method.

    Once you have the byte code you can load it in a custom class loader or call defineClass on the current class loader and run it.

    You may find that compiling and running from the source is easier with the use of the Compiler API or BeanShell.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I was reading java bytecode and saw this: getfield #5 (Field java.lang.String name) What
I have this byte code: new java.lang.Object // stack is [newObjectRef] dup // Stack
I'm receiving this error: java.lang.VerifyError: Bad <init> method call in method FooBar.<init>(I)V at offset
I am trying to understand static analysis of Java bytecode/source-code. These terms frequently come
I am writing a Bytecode instrumenter. Right now, I am trying to find out
Our project does some Java bytecode instrumentation. And we stumbled upon some strange behavior.
I am getting following exception: java.lang.UnsupportedClassVersionError: net/sourceforge/barbecue/BarcodeException : **Unsupported major.minor version 0.0** at java.lang.ClassLoader.defineClass1(Native
Given Java bytecode and ASM bytecode analysis framework, how can I resolve a target
I am trying to learn java bytecode and I stumbled on this: I compiled
In java bytecode why is the receiver is pushed onto the stack first followed

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.