Java Byte Code --- Normal Java Code(Text)

I m making an application IDE(C/C++) for Java, In this I want to give Option to convert Java Byte Code to Normal Java Code(Text).........For This tell me how to do it.

See the page
http://java.sun.com/j2se/1.4.1/docs/tooldocs/windows/javap.html
for a description of javap.exe, the Java class file disassembler.

Similar Messages

  • Is Java Byte Code is 100% platform independent

    Hi all
    A my room fellow is disturbing me about the platform independency of JAVA.
    Now i only wan to know that generated Byte Code will be same if it is generated on different platforms (Window,Linux,Unix etc)using their respected JVM
    Thanks in advance

    The "Platform Independency" of Java is a bit of a joke
    to me. You need a JVM that is platform dependent to
    run it. Now granted, you can write one application
    and itll run on any platform, but that's only assuming
    they have the JVM installed on them. Not to say that
    Java isn't cool and all, but the "platform
    independency" solution still has a reliance on
    something that is platform dependent... It's like
    driving an automatic and saying you can drive....Sure,
    you are making the car go, but something is doing the
    shifting for you....(C: I guess I'm just arguing for
    the sake of arguing...Well if you want to argue that point then no language is platform independant. C code for instance needs a compiler for the platform you want to compile it to run on and that compiled code won't work on any other platform. Ultimately every program has something that ties it to a particular platform, that's just the nature of things in computers.
    The idea of platform independance was the removal of the need to re-compile a program with a native compiler just to get it to run on that platform.
    Instead Sun opted to have a compact JVM to interpert the byte code and have the byte code standard across all implementations of the JVM.

  • Java byte code spec

    Hi, I'm interested in learning more about Java byte codes, but I can't find any kind of specification or other document describing them. Do you know where I could find such document?

    Hi,
    it's here
    http://java.sun.com/docs/books/jls/index.html
    Download is available at the bottom of that page
    greetings Marsian

  • Java byte code

    recently i came across an idea where a it read something about changing a SVG file into java byte code. can anyone give me idea about what i means and what are the applications for someone to do such a thing. i thing just flew right over my head, does anyone have any idea about this at all.
    thanks

    As I recall, there is a xml standard for SVG files. You don't change SVG files into byte code directly. Instead, you interpret the file and create objects. e.g.
    public Shape[] getShapesFromSVGFile(File f) throws IOException;
    Then draw them like any other shape.

  • Executing tiny programming language compiled byte code with the JVM

    Hello,
    For a project, I am developing a simple programming language, with a syntax not unlike Pascal, which compiles to Java Byte Code. Currently I execute the compiled byte code using my own interpreter. This works OK, but what I'd like to do now is to execute the compiled byte code using the actual existing JVM. The compiled byte code resides in a text file upon compilation of a sample program written in my tiny programming language. Does anyone know how I may start to go about this? Thanks in advance.
    adam

    The only way of getting a standard Java virtual machine to execute your java byte code, is to wrap it up into a completely valid java class file.
    Any constants you use, must be put into the classes constant pool.
    Any local variables will have to go into the local variable table of the method which uses them... etc, etc.
    Something like ASM, would let you dynamically create a Java class file.
    http://asm.objectweb.org/
    regards,
    Owen

  • Byte code to file

    Hi,
    I have a code in jsp which encrypts the written text into byte code,now i want that byte code to be converted or written into the file.
    I want a java code which sends the encrypted file to the client program which i have already written.
    That client program will send that file to server,which is already done.
    Now i wanna know how to convert this encrypted text to a file?
    And a Main java code which sends the encrypted file to client program which it further sends to server
    Plz help me am struggling to come out of this trouble from 15 days am not able to write the code since i have no knowledge of JSP

    Let me explain you briefly what I am doing,exactly and also what I need.
    I have these two programs which are in java, which implement my client to server file transfer.
    I want a java program, which will:
    1. call a function that takes my text (as a file or from html front-end) and performs ENCRYPTION (using DES or AES or any other strong encryption method) and then put the encrypted data in a file (example: file1.enc).
    2. next call my sender (Client) process and pass this file1.enc as argument to it. my sender function should be slightly modified to accept this encrypted file as input parameter.
    3.my sender process will send it to the receiver(server) and the server will create a new file (example: file2.enc) in its end. and copy all contents of tranferred encrypted file in it.
    4.then, the receiver should be able to call a DECRYPTION function, which will put the decrypted data in the destination file.
    I have written a code for encryption and decryption already.
    Am attaching ma client and server program here.
    //server program
    import java.net.*;
    import java.io.*;
    import java.util.logging.Level;
    import java.util.logging.Logger;
    public class ServerRun {
    public ServerRun()
    try {
    ServerSocket serverSocket = null;
    boolean listening = true;
    try {
    serverSocket = new ServerSocket(4444);
    } catch (IOException e) {
    System.err.println("Could not listen on port: 4444.");
    System.exit(-1);
    while (listening) {
    new Server(serverSocket.accept()).start();
    serverSocket.close();
    } catch (IOException ex) {
    Logger.getLogger(ServerRun.class.getName()).log(Level.SEVERE, null, ex);
    public static void main(String[] args) throws IOException {
    ServerRun s=new ServerRun();
    class Server extends Thread {
    private Socket socket = null;
    String servermsg[]={"u can i send","i am reciving","receiving is done","bye"};
    String clientmsg[]={"can i send","i am sending","sending is done","bye"};
    public Server(Socket socket) {
         this.socket = socket;
    public void run() {
    try {
         PrintWriter out = new PrintWriter(socket.getOutputStream(), true);
         BufferedReader in = new BufferedReader(
                        new InputStreamReader(
                        socket.getInputStream()));
         String inputLine, outputLine;
         out.println("u can talk");
         while ((inputLine = in.readLine()) != null) {
    System.out.println("Client: " + inputLine);
    if(inputLine.equals(clientmsg[0]))
              out.println(servermsg[0]);
    if(inputLine.equals(clientmsg[1]))
              out.println(servermsg[1]);
    if(inputLine.equals(clientmsg[2]))
              out.println(servermsg[2]);
              if(inputLine.equals(clientmsg[3]))
              out.println("i am closing ");
    break;
         out.close();
         in.close();
         socket.close();
         } catch (IOException e) {
         e.printStackTrace();
    //client program
    import java.io.*;
    import java.net.*;
    public class ClientRun {
    public static void main(String[] args) throws IOException {
    Socket kkSocket = null;
    PrintWriter out = null;
    BufferedReader in = null;
    String s[]={"can i send","i am sending","sending is done","bye"};
    try {
    kkSocket = new Socket("localhost", 4444);
    out = new PrintWriter(kkSocket.getOutputStream(), true);
    in = new BufferedReader(new InputStreamReader(kkSocket.getInputStream()));
    } catch (UnknownHostException e) {
    System.err.println("Don't know about host: .");
    System.exit(1);
    } catch (IOException e) {
    System.err.println("Couldn't get I/O for the connection to:.");
    System.exit(1);
    String fromServer;
    String signal;
    while ((fromServer = in.readLine()) != null) {
    out.println(s[0]);
              while((signal=in.readLine())!=null) { System.out.println("Server response: " + signal); break; }
              out.println(s[1]);
              out.println(args[0]);
              FileInputStream fin= new FileInputStream (args[0]);
              int bytesRead=0;
              byte[] nextBytes = new byte[1024];
                        kkSocket.getOutputStream().flush();
                        OutputStream output = kkSocket.getOutputStream();
                        int tx = 0;
                        while((bytesRead = fin.read(nextBytes)) >0) {
                             output.write(nextBytes, 0, bytesRead);
                             tx += bytesRead;
                        System.out.println("Bytes read: " + tx);
                        //output.flush();System.out.println("output flushed");
                        //output.close();System.out.println("output closed");
                        //fin.close();System.out.println("fin closed");
              //while((signal=in.readLine()) != null) { System.out.println("Server response: " + signal); break; }
              out.println(s[3]);
    out.close();
    in.close();
    //stdIn.close();
    kkSocket.close();
    }

  • Why UnsupportedOperationException after byte code instrumentation using ASM

    Hi All,
    I am getting an run time exception while trying to profile java class after byte code instrumenation using ASM 3.0.
    Error is like :
    java.lang.UnsupportedOperationException: This parser does not support specification "null" version "null"
    at javax.xml.parsers.SAXParser.getSchema(Unknown Source)
    I am trying to add byte code like this. ( I am trying to use a PrintWriter object of my class (Report) to write a Separator ( / ) in a text file and using AdviceAdaptor of ASM 3.0 )
    mv.visitFieldInsn(GETSTATIC, "Report", "printWriterObj",     "Ljava/io/PrintWriter;");
    mv.visitLdcInsn("/");
    mv.visitMethodInsn(INVOKEVIRTUAL, "java/io/PrintWriter", "print","(Ljava/lang/String;)V");
    Please help me to resolve this issue.
    write me if you need more information on this.

    Dont someone has a solution, or got a similar problem ?
    Thought about it could be a bug in the basic java classes of JDev 10.1.2
    but i dont really know...
    Have no idea left.
    Sebastian

  • Managed system Configuration : The JMX metrics of this Host / Byte Code Adapter are missing

    Hi Friends
    While Configuring EP system with SOLMAN 7.1 SP12 it is giving below message in self Diagnosis Phase.
    1. Solman system is already having ISAGENT version 8 and 9 installed (but Managed system is having 8)
    2. I have followed the automatic Process as below
    ==========================================
    Automated Installation of the Introscope Agent via SMD
    The Solution Manager provides an application that performs the setup of the Introscope
    byte code agent for Java automatically. This section explains the steps to run the setup.
    Before you can run the Introscope agent setup, the setup wizard for the managed system
    must have been executed.
    1.
    2.
    3.
    4. Launch the Introscope Setup application: SAP Solution Manager Configuration 
    Managed Systems Configuration  Step 7 Configure Automatically  Automatic
    Activity “Byte Code Adapter Installation”  “Open Java URL” (only available in edit
    mode). Your screen will look similar to the image below:
    5. Check the Enterprise Manager Settings at the top of the screen. These are the
    connection parameters that will be used by the agent to connect to the Enterprise
    Manager.
    6. In the pane Introscope Agent Setttings, select the system that you want to instrument
    with the agent. Check “select all” and click “Retrieve Current Settings”. This will display
    the current status of the agent setup.
    7. To initially setup or update the agents, click Setup Introscope Agent …. This will open
    the setup dialog as shown below. Select the desired agent version (by default only one
    available) and choose the profile. Next, check the desired instrumentation areas, and,
    in the case of AIX, review the AIX settings to match your environment (J9 or classic
    mode).
    8. Finally, hit Apply to perform the necessary changes in the agent configuration. Agent
    config files will be adapted and the Java VM parameters will be set as required for the
    managed system.
    ================================================================
    3. Restarted SAP but error still present.
    Please help to resolve the issue.
    Thanks

    Found the solution :
    1819577 - Workload Analysis data missing for Java systems when using ISAGENT 8.2.4.0
    Cause
    l This issue has been identified as product defect and documented in note 1273028
    Resolution
    l As mentioned in note 1273028, update to ISAGENT 8.2.4 Patch 1 timestamp: 2012-06-26, please proceed as described below)
    1. Enable the Maintenance Mode in the Agent Administration UI (http://solmanserver:port/smd/AgentAdmin)
    2. Deploy the file to the Solution Manager JAVA stack using the Software Deployment Manager (SDM)
    3. Disable the Maintenance Mode in the Agent Administration
    4. Execute again the activity 'Byte Code Adapter Installation' of the step 'Configure Automatically' in the 'Managed System Configuration' for the
    affected systems. This activity will deploy the new version of the
    Introscope JAVA agent in the managed system servers and reconfigure the JVM parameters to use the new version of Introscope JAVA
    Agent;
    5. Check from Introscope Agent Admin if "IS Agent State" contains value "Running but needs restart"
    6. Restart the affected managed system(s)
    Finally Solution is update your SOLMAN system patch ISAGENT 8.2.4.0 from patch 0 to 1 via SDM.
    Thanks
    Mukesh

  • Question about Byte Code

    Hello...can anyone tell me how I write a java program, compile it and get my byte code written into another file??
    Thanks in advance!

    I am looking to write my bytecode into a .bc file and
    open it and actually be able to read the bytecode
    instruction...(stuff like iload_2, i2d etc.,)I see... that was not clear from your first question. What you want is a disassembler. The SDK comes with one called 'javap': http://java.sun.com/j2se/1.4.1/docs/tooldocs/windows/javap.html

  • Can Java convert text in to three dimensional forms?

    Hi,
    I'm an MA student at Central Saint Martins College of Art and Design in London. I'm currently working on a project to convert text, entered onscreen by users, into three dimensional forms when initiated by clicking on a button. Each 3D form is to be unique to the text entered. Does anyone know how best to do this and whether Java is the best tool for this? Any help or ideas that can be offered will be greatly appreciated.
    Thanks

    Hi,
    Thank you for your help, the link is a great starting point in the development of my project, but its not the "nail on the head", which is my fault. On reading back my last posts it seems I omitted a key word (sorry, my mistake) in the description of what I want to do, which is: "…can Java convert text into abstract three dimensional forms?" By abstract three dimensional forms I was hoping to create something along the lines of what is possible with Rhinoscript, here is an example of the type of visual I want to be able create from the transformation of user entered text using computer code: http://www.theverymany.net/uploaded_images/080108_Srf_Test001_01_k_TVM-718625.jpg. I hope this sheds some light on the direction I'm hoping to take, so if you or anyone else can offer any more help or pointers I will be eternally grateful.
    Thanks

  • Question about compiled byte code

    Howdy folks,
    I have a client who wants to run an application in both
    on-line and off-line modes. The user could run the application
    locally on their laptop making changes and such which would get
    stored to local database files (probably FoxPro free tables just to
    make it easier on me). Then when the user got back to their
    internet connection they could run the application and it would
    sync with the online tables (probably MySql tables at that point).
    So the question is, if I compile Cold Fusion code into Java
    byte code, will it be able to execute independantly of the Cold
    Fusion Server? I realize that I could load ColdFusion on the user's
    laptop, but I don't think I want to do that. I'm assuming that the
    answer to my question will be "No. You can't do that. Cold Fusion
    isn't meant to work like that." To which my next question would be,
    "Well, what language would be best for the type of application I
    have described above? Action Script, maybe?"
    Any thoughts are welcome, especially if you've written an
    application like the one I've described.
    Thanks very much,
    Chris

    Well, rats.
    I wrote a nice reply to your message BKBK, but lost it
    because, apparently, my session timed out.
    The basic jist, was that I've been working on AJAX, and have
    been implementing some AJAX-like techniques at some other clients
    (using hidden iframes combined with innerHTML -- I know not a
    standard, but darn handy otherwise), but I couldn't see how that
    would solve my on-line/off-line problem (unless I stuck with the
    cookies idea).
    I also did some reading on cookies last night (obviously, I
    don't use cookies very often if at all in my daily coding), and I'm
    a bit put off by the different browser limitations. I'd hate my
    client to be chugging along, entering appointments into the
    "database" (read: data being stored as cookies to be sync'd later
    when the user goes online), and then suddenly run into the cookie
    limitation. On top of that, if I'm reading right, IE (my client's
    most likely choise of browser), will not let you know that you've
    reached this limit, but will just begin dropping the older cookies
    in favor of the newer ones. If I could programmatically sense this
    limitation and then write the cookies to some file before
    continuing that'd be geat, but since JavaScript can't write files
    (that I know of) this isn't feasable. Also, if I could write a file
    like that, I wouldn't bother with the cookies.
    I think I'm going to end up writing it in FoxPro since my
    company has a bunch of copies of it (and it's licenced per
    developer and not per copy), and there are lots of folks in my
    company who can help me get up to speed. That also means that I'll
    probably need to write a web version of the code for when my
    client's client's (does that make sense? :-) ) connect to the app
    via the internet.
    Anyway, I'm really enjoying everyones comments on the
    subject. Can anybody think of a technique for a way around the
    cookie limitations? Or perhaps another language that this whole
    thing could be written in?
    I really wish that I could compile my ColdFusion code for use
    independant of the CF server. I know, that's not the way it works
    and typically not what scripting languages like this are used for.
    I suppose I could always install the developer's version of CF on
    the user's local machine, write the code in CF and then just detect
    whether or not the user is online and behave accordingly.

  • Inheritance and byte-code...

    My coworker and I were having a discussion today that I imagine someone here will be able to resolve for us: we were talking about how wonderful inheritance is (when used properly, of course), and the issue of the compiled byte-code came up.
    Basically, it was my conclusion that a subclass contains only the byte code that differentiates it from the superclass; in other words, if a superclass is modified and recompiled, there is no need to recompile the subclass for the changes to take effect. My coworker disagreed, however, arguing that there would be linking problems between the two classes if the subclass was not recompiled (sign of an old assembly programmer, if you ask me).
    Anyone know the answer to this?

    I created a trivial Parent class and extended it with an
    even more trivial Child class. I compiled both classes
    and then made a change to the Parent class. After
    compiling the Parent class only, the change took effect
    in the Child class. This indicates that you are right and
    your co-worker is wrong. Here are the classes if you
    would like to show him.
    import java.awt.*;
    public class Parent
         Dimension d;
         Parent() {
              d = new Dimension(333, 777);
         public Dimension getDimension() { return d; }
    import java.awt.*;
    public class Child extends Parent
         Dimension d;
         public Child() {
              d = getDimension();
              System.out.println(d.height + " " + d.width);
         public static void main(String[] args) {
              new Child();
    }Mark

  • Strange Error - 5005: Unknown error optimizing byte code.

    Hello flashcoders,
    I am facing strange problem since long time. This error code
    even doesn't exist in the list of error codes.
    This is the exact error I am getting while I compile the FLA
    from flash CS3.
    Location : , Line 1
    Description : 5005: Unknown error optimizing byte code.
    Source :
    I don't know exact reason about its generation, But here are
    the some possible reasons / hints:
    Case 1) Overloading:
    1.1) Size of .fla is 10.5 MB and its document class contains
    more than 60 classes to import and has more than 100 variables.
    1.2) Even if I put In document class - only variable
    initialization and class importing are there. Nothing in its
    constructor + no other functions are defined. Still error is there.
    1.3) If we import all classes and has all variables then it
    gives this compile error. But if we remove some particular numbers
    of variable, it's start working. In this we can remove any type of
    variables.
    1.4) After reducing variables, application starts working
    till that it won't.
    Case 2)
    2.1) Size of .fla is 1.75 MB and its document class is same
    as above one.
    2.2) All assumptions are same as above.
    2.3) Now this class contains all functions and have
    initialization of all variables + classes.
    2.4) In this If we remove 3-5 variables, it will start
    functioning else it won't.
    Its a huge application so I am even confused that what is the
    cause of error and this error stopped our working for a week now.
    Bit more information about the project that may help the team to
    identify the reason.
    1. Project development started with flash public alpha 3.
    When we started using Flash CS3, we had some design problem if we
    do open the FLA in CS3, so we completely redesigned the Movieclips
    etc., in Flash
    CS3 IDE.
    2. Project contains approx 250 classes.
    3. In main application, it imports 67 classes. (it works if I
    keep 63 classes in document class).
    4. In the case 3 above, if that works with 63 classes and If
    I do add 3 frames in existing movieclip, it stops working.
    5. In the case 3 above, if that works with 63 classes and If
    I do add / declare few more variables, it stops working.
    It would be humble appreciation if someone can come up with
    some light in the dark tunnel.
    Best Regards,
    Ashvin Savani - "arckid"
    Founder & CTO - Avinashi.com
    Adobe Community Expert
    We Never Give Up!

    I've posted an article on this problem -
    http://www.negush.net/blog/5005-unknown-error-optimizing-byte-code/
    - and here are a few ideas on how to handle it (check out the
    comments):
    - try turning off the optimizer
    - delete ASO files
    - also it seems that changing the java vm heap memory size
    could help (find he environment variables in the Windows computer
    properties and search the JAVA_TOOL_OPTIONS variable)

  • JDK 64k byte code limitation for methods

    Concerning the JDK 64k byte code limitation for methods (actually 65535 bytes): While the Java compiler doesn�t care for that problem, the Java VM does. Hence, an violation of the 64k limit is dedected at run time, too late, of cource. Is it possible to detect the violation at (or immetiately after) compile time? Are there any tools that support the perception of the violations as early as possible?

    Thanks to the authors of the answers. I agree to you as far as hand-written code is concerned. However, we generate our java classes, thousands of files, each java class with a lot of methods. We do have rules to keep things as smal as possible. Nevertheless, some methods become very large. Thus the problem is to detect such methods. Once the methods are known, we are able to modify our generator. We implemented a small program that looks for large methods in terms of source code, but there is just a week correlation between source code and byte code. Hence, again the question: Is there a tool that supports the detection of methods larger than 64k byte code before installation?

  • Can we invoke a method using BCEL(byte code engineering library)

    Hi i am new in Java bcel,So can anyone guide me in this problem.
    I am searching for some techniques in BCEL to invoke a method of some class just like we use to invoke methods using Java Reflection.I have also tried a Java Assembler named "Jasmin" that used to interact with Operand Stack,Local variable array & Constant Pool etc so i guess this is the same containers with which our BCEL also interact with so then i am wondering why not then there exists a way through which we can invoke a method using BCEL IF this will happen in any case then kindly point it out some direction of help.
    thanks in advance

    856989 wrote:
    I think i have clearly mentioned that "Tell me any way in doing this invocation in BCEL not in Reflection."
    Why i not want to use reflection because it have "invocation overhead"Wrong.
    If I dynamically load a class and reference it via a interface there is absolutely no difference in that and if I referenced the class statically and used it via an interface. The load and use process is exactly the same.
    And the first uses "reflection".
    If you use a proxy interface via something like java.lang.reflect.Method
    then of course there is some overhead because there is in fact more classes involved. Just as if you had any other layer in any other code.
    And even so unless you have actually profiled the application and found an actual bottleneck (and not just a measured impact) then even looking at it is a waste of time.
    If it was me I would be far more concerned that inserting byte codes was correct for all cases.

Maybe you are looking for

  • ASA 5505 no internet

                       Dear all i have a problem with ASA 5505 i have three vlans : Inside, Guest, Outside the Inside's vlan network is 172.16.100.0  255.255.252.0 Guest                           is 192.168.1.0    255.255.252.0 Outside                   

  • Some Songs wont Play over Air port

    Having just downloaded some music I find that "this music only" will not stream to my remote speakers but other music works fine why is this?

  • Smart question

    We all know that TalkTalk have joined BTs fibre network and offer the new 80 download and 20 upload well if I went with TalkTalks deal and have bt home hub 3.0 it would be much cheaper than if I was to go with BTs deal the same one 80 download and 20

  • I am unable to open my pdf..it keeps on asking me password .want to reset my password

    Plz reset my passw

  • Adobe PDF 8 will not "print". It pauses instead.

    I upgraded to Leopard. Now when I attempt to create a PDF file by printing using the Adobe PDF 8 printer, the file will process into the printer job list, and then the printer will PAUSE. No amount of Resuming or restarting the print queue will get t