Thiz iz Urgent..........How to convert a .class file to a .java file

Hi Everybody,
I want to convert back a .class file (a compiled servlet) into .java (source code) file. How do I do it???
Note using javap has not been of any help.
Thanks in Advance
Rajib

Why don't you look at this thread:
http://forums.java.sun.com/thread.jsp?forum=31&thread=143500
If thats not enough, try searching all the forums for:
"convert .java .class" That'll give yu a bunch of other threads...
Sjur

Similar Messages

  • How to call inner class method in one java file from another java file?

    hello guyz, i m tryin to access an inner class method defined in one class from another class... i m posting the code too wit error. plz help me out.
    // test1.java
    public class test1
         public test1()
              test t = new test();
         public class test
              test()
              public int geti()
                   int i=10;
                   return i;
    // test2.java
    class test2
         public static void main(String[] args)
              test1 t1 = new test1();
              System.out.println(t1.t.i);
    i m getting error as
    test2.java:7: cannot resolve symbol
    symbol : variable t
    location: class test1
              System.out.println(t1.t.geti());
    ^

    There are various ways to define and use nested classes. Here is a common pattern. The inner class is private but implements an interface visible to the client. The enclosing class provides a factory method to create instances of the inner class.
    interface I {
        void method();
    class Outer {
        private String name;
        public Outer(String name) {
            this.name = name;
        public I createInner() {
            return new Inner();
        private class Inner implements I {
            public void method() {
                System.out.format("Enclosing object's name is %s%n", name);
    public class Demo {
        public static void main(String[] args) {
            Outer outer = new Outer("Otto");
            I junior = outer.createInner();
            junior.method();
    }

  • How to convert a class file to exe file and how to cteate a class file to d

    how to convert a class file to exe file

    Hi Bhaskarq,
    Hi,
    It is not at all possible.
    But it is a really worst method.
    Please go through it.
    This is a very common question asked in the comp.lang.java newsgroup. Its often useful to have an
    executable application when deploying your
    applications to a specific platform, but remember to
    make your .class files available for users running
    Unix/Macintosh/other platforms.
    Microsoft provide a free system development kit (SDK),
    for Java, which includes the jexegen tool. This
    will convert class files into a .EXE form. The only
    disadvantage is that users need a Microsoft Java
    Virtual Machine (JVM) installed. If your target
    platform is Win32, you can either redistribute the
    virtual
    machine, or raise the level of your system
    requirements, to include Windows 98, or Windows 95
    with
    Internet Explorer 4. Systems matching these
    requirements will already have a copy of the Microsoft
    Java Virtual Machine installed.
    Note : You must specify all of the class files your
    application needs (except for standard java packges)
    as a parameter, so if you have third party libraries,
    you'll need to include them as well. You can use wildcards * though, and you don't need the original source code.
    Also please see this Forum which will give a good idea
    http://forum.java.sun.com/thread.jsp?forum=31&thread=149733
    I hope this will help you.
    Thanks
    Bakrudeen
    Technical Support Engineer
    Sun MicroSystems Inc, India

  • Any 1 know how to convert a class to jar??

    How to convert a class file to jar executable file??

    Here's a jar tutorial.
    http://java.sun.com/docs/books/tutorial/deployment/jar/index.html

  • How to convert the class in the one package to same class in the other pack

    How to convert the class in the one package to same class in the other package
    example:
    BeanDTO.java
    package cho3.hello.bean;
    public class BeanDTO {
    private String name;
    private int age;
    * @return
    public int getAge() {
         return age;
    * @return
    public String getName() {
         return name;
    * @param i
    public void setAge(int i) {
         age = i;
    * @param string
    public void setName(String string) {
         name = string;
    BeanDTO.java in other package
    package ch03.hello;
    public class BeanDTO {
    private String name;
    private int age;
    * @return
    public int getAge() {
         return age;
    * @return
    public String getName() {
         return name;
    * @param i
    public void setAge(int i) {
         age = i;
    * @param string
    public void setName(String string) {
         name = string;
    My converter lass lokks like
    public class BeanUtilTest {
         public static void main(String[] args) {
              try
                   ch03.hello.BeanDTO bean=new ch03.hello.BeanDTO();
              bean.setAge(10);
              bean.setName("mahesh");
              cho3.hello.bean.BeanDTO beanDto=new cho3.hello.bean.BeanDTO();
              ClassConverter classconv=new ClassConverter();
              //classconv.
              System.out.println("hi "+beanDto.getClass().toString());
              System.out.println("hi helli "+bean.toString()+" "+bean.getAge()+" "+bean.getName()+" "+bean.getClass());
              Object b=classconv.convert(beanDto.getClass(),(Object)bean);
              System.out.println(b.toString());
              beanDto= (cho3.hello.bean.BeanDTO)b;
              System.out.println(" "+beanDto.getAge()+" "+beanDto.getName() );
              }catch(Exception e)
                   e.printStackTrace();
    But its giving class cast exception. Please help on this..

    Do you mean "two different layers" as in separate JVMs or "two different layers" as in functional areas running within the same JVM.
    In either case, if the first class is actually semantically and functionally the same as the second (and they are always intended to be the same) then import and and use the first class in place of the second. That's beyond any question of how to get the data of the first into the second if and when you need to.
    Once you make the breakthrough and use one class instead of two I'd guess that almost solves your problem. But if you want to describe your architecture a little that would help others pin down want you're trying to do.

  • How to convert a .class file?!!

    sorry guys,
    but I've a question in knowing the code of some file,
    I've zipped file, when I unzip it, it contains an html page with a .class files
    (passing parameters to applet)
    my problem is that I want to know the code of the .java file (which is not included)
    but the program is working well, coz I have the .class file,
    so, can I convert this .class file into a java file, so its java code could be readable (to understand it)
    thanks in Advance :)

    sorry man, but Can't u send me a specific link for downloading this "Java decomplier"
    coz I found my self in something called (jad decompiler) with lots of versions and this is confusing
    and Is that mean, that there's a decompiler which can convert the .class file into .java one?
    and thanks alot man.....u help me always!
    (I'm still begginner in java)

  • How do you convert a jar file into a java file,  ?

    how do you convert a jar file into a java file ?
    I am new to Java ,but have a little experience in C++ and Visual Basic.
    I want to edit and maybe create my own mobile games that are written or converted into jar files.
    At the moment I am using Java NetBeans , and Easy Java( the java pad).
    However the only solution I tried was to open the JAR file in winrar and see that its made up of png picture files,
    midi music files and class files. Unfortunately when I uncompressed the JAR file , there was NO java file to be seen and the JAVA editors Do not show the class file like a Java file. So why is there no extension Java file in the mobile JAR game ?

    801283 wrote:
    how do you convert a jar file into a java file ?You generally don't. There exist decompilers, but if you're meant to have the source, you should either have it because you are the author, or you should be able to get it from the author.
    I am new to Java ,but have a little experience in C++ and Visual Basic.Does that experience include turning .exe files into C++ code? Because that's the equivalent of what you're asking
    I want to edit and maybe create my own mobile games that are written or converted into jar files.Eh?
    Are you saying you want to take existing games and modify them? If the creators allow you to modify their source, then they'll provide you with that source (the .java files). If you're allowed to add things but not modify, you don't need .java files. Just documentation, which, again, the creators should be providing.
    Or are you saying you want to create your own games and distribute them in jar files? If so, there's no need to turn jars into .java.
    However the only solution I tried was to open the JAR file in winrar and see that its made up of png picture files,
    midi music files and class files. Unfortunately when I uncompressed the JAR file , there was NO java file to be seen and the JAVA editors Do not show the class file like a Java file. So why is there no extension Java file in the mobile JAR game ?Why would you expect there to be one?

  • How to convert Oracle reports previewer output into delimited file.

    How to convert Oracle reports previewer output into delimited file if the report has more than 1000 pages.
    I tried with previewer option File --> Generate to file --> Delimited file, but the report engine is crashing.Not generating .TXT file.
    I observed that this option is not working for more than 400 pages.
    I am using Oracle reports 6i version.
    Plz suggest me to generate .TXT file from Report previewer.

    You can specify a delimiter (a character or string of characters) to separate the data (boilerplate or field objects) in your report output in either of the following ways:
    On the command line using the DELIMITER keyword.
    In the Delimited Output dialog box or DelimitedData Output dialog box (displayed with File > Generate to File > Delimited or File > Generate to File > DelimitedData) in Reports Builder.
    for further information goto this link
    http://download.oracle.com/docs/cd/B14099_17/bi.1012/b13895/orbr_concepts2.htm#sthref760

  • How to convert a webpage program into a pdf file?

    how to convert a webpage program into a pdf file?

    Hi Federico,
    ExportPDF is the program to convert PDF into different Formats(Doc, Docx, xlsx, rtf) and not Vice Versa, I would suggest you to use CreatePDF Web application for converting any other format to PDF.
    For more details on CreatePDF
    https://www.acrobat.com/createpdf/en/home.html
    FAQ to be found here:
    http://forums.adobe.com/community/createpdf?view=documents
    ~Pranav

  • How to view the change immediately after a java file is modified without restarting server or redeploy?

              Hi All,
              How to view the change immediately after a java file that is used in jsp is modified
              without restarting server or redeploy?
              Moreover, it is better to keep the original session.
              Any suggestion is appreciated.
              Kammau
              

              Hi,
              In order to have a new version of a java class, the current classloader must be
              deleted and a new one created. This is what redeployment does. I believe that
              this is more of an issue with Sun's implementation of classloaders. You could
              ask BEA support (719.232.7878) and see if they have any plans to periodically
              check jar files to see if java class file timestamps and destroy and re-create
              classloaders on the fly.
              1) You will still have to accept the performance hit of destroying classloaders
              and creating new ones. There isn't any way around that.
              2) I would think you would want to have more explicit control in production and
              integration anyway.
              You can redeploy applications from the command line (script) file not just the
              console.
              Hope this helps,
              pat
              "Kammau" <[email protected]> wrote:
              >
              >Hi All,
              >How to view the change immediately after a java file that is used in
              >jsp is modified
              >without restarting server or redeploy?
              >Moreover, it is better to keep the original session.
              >Any suggestion is appreciated.
              >
              >Kammau
              

  • How to make a jar file from a java file?

    how to make a jar file from a java file, is there any one tht can help me thank you;

    You can study this.
    http://java.sun.com/docs/books/tutorial/jar/basics/index.html

  • How to call a html file in a java file

    how to call a html file inside a java file ?

    Hopeless. Are you by any chance a rare gas? You seem completely inert. LOL You totally pwned him there :rolls eyes:
    well, no, I think he's looking for something to this degree:
    in HTML, there is a mailto: command that makes the system default handled way to email emails open up. He's looking for a command thats very nice and opens a html file in the system default browser.
    So, Dick, Runtime.exec would work execpt that he needs a way to find the default system browser to call exec on, AND he has to know how to pass html file locations to the executable via command line arguments
    He just didnt try to phrase it at all :P

  • Is it possible convent .Class file back to .java file? or human readalbe .

    Hi there.
    i'm just wondering, is it possible convent .Class file back to .java file? or human readalbe chars?

    Search for jad decompiler then install into what ever directory you wish.
    Its dos base so copy what ever .class into the jad directory then
    in command prompt go to the directory with jad, run jad then type
    jad -s<java> <filename>.class
    It is a very good program

  • How to convert a .class file into .java file without .jad using DeJDecompil

    Hi all,
    I am using DeJDecompiler and working with swing applications.If I try to convert a .class file into .java file,it is converting into .jad file only.Fine but if I try to save that file into .java file,It is giving lot of errors in that program.When I went into that program the total style of the program is changed and TRY-CATCH block is not recognised by the dejdecompiler,hence If I try to include some methods in the existing .java file thus got,I could not do.Kindly help me.
    If I get the .java file without error then I can process the rest of the functionality.
    Thanks in advance
    With kind Regs
    Satheesh.K

    Not so urgent today then!
    http://forum.java.sun.com/thread.jsp?thread=553576&forum=31&message=2709757
    I'm still not going to help you to steal someone�s code.

  • Urgent  urgent  urgent how to convert 20 ear file into  1 sca file

    hi experts, friends
    help me if are intersted with this question  ( its very urgent )_
    my questions is
    1 . how to convert the 20 ear files into 1 sca file
    2 . how can i do that is there any 3rd party tool is there to convert
    descripation :- i have 20 application which are developed by  ui webdynpro java . 20 application are in .ear
    files, that i can see in sdm tool. now i need to pack or bundil all 20 application or .ear files into 1 .sca file.
    plz help me to resolve this issue
    regards
    raja

    Raja,
    The following conversions are possible:
    PAR to EAR
    EPA to SDA
    EAR to SDA
    SDA to SCA
    Check with this SAP Help to make SDA file first and then
    SDA to SCA.
    [Creation of SDA and SCA Archives|http://help.sap.com/saphelp_nw70/helpdata/EN/a3/782240da03e569e10000000a155106/frameset.htm]
    Check out this SAP Note as well :
    Note 696084 - EP 6.0: How to create SDA files for EPA or PAR files
    You can use the Command Line tool if your environment is SAP NetWeaver 7.1 Composition Environment (CE).
    [Composition Environment Command Line Tool |http://help.sap.com/saphelp_nwce10/helpdata/en/45/5a3613dca22a4ce10000000a11466f/frameset.htm]
    or
    Follow the way mentioned here.
    [Adding Transport Packages to NWDI|http://help.sap.com/saphelp_nw70/helpdata/EN/45/bd060552fd731de10000000a1553f6/content.htm]
    Regards,
    Karthick Eswaran
    Edited by: Karthick Eswaran on Jun 20, 2008 8:50 AM

  • Very Urgent--- How to Convert Non Valuated stk into Valuated

    Dear GURU'S
    Actually for a material A when i see the stock in MM03 in accounting tab i see less stock then when i see in MMBE
    i.e in MMBE if i select Material A and Plant B(Which is depo in my case) i see stock as 39
    but for same material MAterial A and Plant B ,if i see in MM03 --in accounting tab i m able to see less stock i.e only 1
    ============================================
    Well the problem is In MM03 I cud see only valuated stk i.e qty as 1
    And in MMBE for a partiocular material for a particular plant the stock was 39
    i.e Here i am getting Valuated + Non valuated stock
    i.e i am getting difference of 25
    =====>>>
    To get into the root cause
    I have gone to MB5B where i can get all the transaction that has been done on this material with movement type also i got the intial stock ,Goods recpt ,Goods  issu and total stock
    No for a particular material
    In MB5B it is showing
    Stock on 01.01.2005    =  38
    receipts total               = 238
    Issues total                  =237
    Stock as on 18.02.2008 = 39(which is equal to Stock in MMBE)
    =============>This is for valuated +Non valuated stock
    Where as if i want to see only valuated stock it was showing
    receipts total      = 238
    Issues total         =237
    Stock as on 18.02.2008 =1  (which is equal to stock in acctg view in MM03)
    ====================>This is only for Valuated Stock
    ======================================
    Now how to solve this :
    The initial qty(38) which has been posted it was at the begining that is at the start of the project
    And the people who have posted it ,it was non valuated
    that is the reason it is showing difference in MM03 and MMBE
    First thing
    How can i see on which date this initial stock has been posted
    Second Query
    How to convert this non valuated stock into Valuated stock
    So that the quantity in MMBE and MM03 gets matched
    Willl award 10 Points if my problem gets solved
    THANKZ IN ADVANCE
    REgds
    Shailesh

    Dear friend
    Actuallly i have checked the history of that particular Item in MB51
    I have gone through all the documents created for this material
    Now this material also exist in DEPO which is located at chennai and plant is at mumbai
    So Initially in the year-2006(31-10-2006) whater documents are created i.e STOP has  been created and delivery has been made (Mov type-601)
    are non valuated stock ,means they have been posted without any valuation
    But from year 2007(01.02.2007) the documents whiohc have been posted are valuated
    i.e is the reason when i am executing transaction MRN9 to check the history of valuated stock
    I cant see non valuated stock
    Well now how to do the valuation of this stock which have been posted in year 2006 so that
    In MMBE and MM03 there is no difference of stock
    Plz hepl
    regds
    shailesh

Maybe you are looking for

  • Rules not working in GW 7.0.3

    I am trying to automatically have all listserv e-mails sent to a designated folder. When I use RULES to designate which e-mails to send to folder, it doesn't work. I've tried setting up the "condition" in a couple different ways, either by "subject"

  • Unable to find visa refnum

    I am trying to run several VIs connected to different serial ports-all at the same time.I got the error:1073807246-I was trying to clear it in the way described in this forum-by creating a VI with a 'refnum' wired as input to the VISA close session.I

  • Outline Stroke – normal behaviour?

    Here's a strange anomaly I bumped into. I drew a single open path with its ends crossing (see black line on the shot below). When I outline the stroke everything runs into one instead of overlapping (see red shape). Separate paths produce overlapping

  • Print from wireless laptop and print comes out hours later

    My wife has a wirelessly connected laptop and when she prints from it, the printer doesn't print for a few hours.  When I print from the desktop which is connected directly to the router it prints right away.    We have a Netgear router, windows 7 an

  • 30 Day Edge up is a joke!

    I have been trying to edge up under the 30 day deal you currently have going right now for the past 3 weeks! I have called and called and called and no one has been able to do anything. I have been in 3 corp stores as well as many calls resulting in