Convert file.class in file.java

i lost my file.java how to convert my file.class in file.java? help me please!!!!!!!!!!

search for java decompiler. just know that it won't be anywhere as near easy to read as the original.
-S-

Similar Messages

  • File class question

    Hi all,
    I've been playing with the File class (as a way of learning about it) and am confused about the behaviour of the following code.
    This class is uses recursion as a way of getting a file structure.
    import java.io.File;
    public class FileTest {
        public static void main(String[] args) {
            if (args.length == 0) {
                return;
            File file = new File(args[0]);
            processFileList(file);
        public static void processFileList(File f) {
            if (f.isDirectory()) {
                System.out.println("found directory: " + f.getName());
                String fileList[] = f.list();
                for (int i=0; i < fileList.length; i++) {
                    File newF = new File(fileList);
    if (newF.isFile()) {
    System.out.println("Found file in list: " + newF.getName());
    } else {
    System.out.println("Found new directroy is list: " + newF.getName());
    processFileList(newF);
    } else {
    System.out.println("Found file: " + f.getName());
    The command line I use is java FileTest testdir
    The output from the code is:
    found directory: testdir
    Found file in list: FileTest.class
    Found file in list: Hello.class
    Found file in list: LogTest.class
    Found new directroy is list: testdir2
    Found file: testdir2
    The file structure being used is testdir, which contains the three class files and a directory called testdir2. testdir2 contains some java files.
    I don't understand why testdir2 is recognised as not being a file, but is not recognised as being a directory. I changed the code to use isDirectory() rather than isFile(), but the results were similar, testdir2 is not recognised as a directory.
    Any ideas? Thanks,
    dan

    When you instantiate the class java.io.File from a String you should use a pathname or depict the parent directory as well as the abstract file name. Or you could use the method listFiles() of the File class.
    File[] fileList = f.listFiles();

  • How to convert a .jsp to a .java/.class file for use in peoplesoft

    Hi java/jsp experts,
    I want to convert a .jsp to a .java/.class file. is there a tool available, please let me know if you have any pointers....
    or can i do it manually:
    these are a few lines that the .jsp contains, and i would like to translate this to be in .java/.class format:
    <%@ page import="sun.misc.BASE64Encoder, javax.crypto., javax.crypto.spec."%>
    <%@ page import="java.util.StringTokenizer" %>
    <%@ page import="java.util.Map" %>
    <%!
    sb.append("<input type=\"hidden\" name=\"orderPage_serialNumber\" value=\"");
    sb.append(serialNumber);
    sb.append("\">\n");
    return sb.toString();
    %>
    how can i translate the above import statements and html elements from jsp to java, please let me know.
    Once i have the .java file created from the .jsp, I will compile .java to create the .class file and invoke the .class in peoplecode by using java apis available in peopletools.
    Thanks in advance.

    Is there a way convert a binary .exe file( compiled by
    another compiler) into Java .class/.jar file ? Anyone
    know of a free program that can do this?It's not possible. There are many decompilers and disassemblers for Java but nothing will take you from ANY binary to Java source. It would be the end of computing as we know it and the beginning of a new era -:)

  • 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.

  • How to convert java .class file to .dll file

    hi,
    I got a problem, I have to convert my java .class file to .dll file. Microsoft VC++ program will invoke the converted .dll file.
    Is there any other possibility.
    I was confused.
    Cam any body help me. If you are having solution for the can you send to my [email protected] account.
    thanks,

    No, it is not possible to do what you are suggesting. Yes, you could produce a DLL that wraps the JVM and loads your java class exposing a C and/or C++ callable interface, but that is a lot to go through unless your class is VERY complex. Otherwise, you might want to just create and maintain two implementations.

  • How to convert the javasource file(*.class) to execute file(*.exe)?

    How to convert the javasource file(*.class) to execute file(*.exe)?
    thank you!

    Although i have seen a few programs (that are platform specific) that will embed a small jvm into an exe with your class file, it is generally excepted that you cannot create an executable file using java. The JAR executable file is probably the closest your going to get
    Pete

  • 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 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

  • How to convert .class file to .dll file

    hi,
    I got a problem, I have to convert my java .class file to .dll file. Microsoft VC++ program will invoke the converted .dll file.
    Is there any other possibility.
    I was confused.
    Cam any body help me. If you are having solution for the can you send to my [email protected] account.
    thanks,

    No, it is not possible to do what you are suggesting. Yes, you could produce a DLL that wraps the JVM and loads your java class exposing a C and/or C++ callable interface, but that is a lot to go through unless your class is VERY complex. Otherwise, you might want to just create and maintain two implementations.

  • Converting a class file to a dll

    Hai please help me..
    I am trying to convert my .class file to a .dll file.
    This is my java code:
    public class DateFunctions {
         public int getTimeInSeconds(int i){
              return i;
         public int addNumbers(int i, int j) {
              return (i+j);
         public static void main(String[] args) {
              DateFunctions df=new DateFunctions();
              df.getTimeInSeconds(
    Created class file DateFunctions.class.
    Created jar DateFunctions.jar using:
    jar cvf DateFunctions.jar DateFunctions.class
    Generated dll file using bimp tool like this (Visual J# .NET tool):
    jbimp DateFunctions.jar /t:library
    I got the file: DateFunctions.dll
    Now loaded this dll into my code (say, TSL code in WinRunner) using load_dll("DateFunctions.dll");
    When I try to access the method like:
    j=getTimeInSeconds(int i);
    I am getting the error RPC error.
    Note: DLL is loading fine. but while accessing the functions I am getting the RPC error..
    What could be the reason..?
    Please help...?
    Thanks,
    Satish

    Your answer lies in the documentation for WinRunner and whatever else is calling the DLL.
    Certainly Java JNI has requirements for DLLs called from Java: They have to be C++ bindings that use the native header that Java generates, right?
    So now you need to look at the requirements for your WinRunner and make sure that the program translating your .class file to a DLL does it in a such a way that the bindings WinRunner expects are indeed there.
    But none of that has anything to do with Java. If your Java class compiles and tests successfully, then your questions about Java are satisfied. You have to figure out what WinRunner needs and what's missing from what you supplied.
    %

  • What is the wrong about converting the .class of api of jc to .cap files?

    hi everyone
    l tried to convert the .class filses of api to .cap files,there are some wrongs please help me!
    ___the .opt file:___
    -out JCA CAP EXP
    -exportpath D:\jCDK2_2_1\api_export_files
    -classdir D:\workspace\framework
    framework
    0x0a:0x0:0x0:0x0:0x62:0x1:0x01 1.2
    converter result:
    c:documents and settings\administrator>converter -config d:\workspace\framework\framework.opt
    java card 2.2.1 class files converter ,version 1.3
    copyright 2003 sun microsystems,inc.all rights reserved.use is subject to license terms
    error:javacard.framework.JCSystem:unsupported method modifier native in method isTransient.
    error:javacard.framework.JCSystem:unsupported method modifier native in method makeTransientBooleanArray.
    error:javacard.framework.JCSystem:unsupported method modifier native in method makeTransientByteArray
    error:javacard.framework.JCSystem:unsupported method modifier native in method makeTransientShortArray
    conversion completed with 13 errors and 0 warnings.
    thanks in advance

    Hi,
    I am not sure why you are trying to convert the API packages into CAP files. The JAR files that ship with the JCDK are only stub implementations for compiling against. They do not have an actual implementation. You will find methods returning a short always return 0 etc. You should only need to convert your code into CAP files. You will just need to reference the .exp files that are included in the JCDK for the API so your code can be converted.
    Cheers,
    Shane

  • Convert tline into pdf file document in Java

    Dear ALL,
         I built a RFC FM to convert smartform into tline which including PDF data.
    the Code:
       Converting to PDF Format
      DATA l_lines TYPE TABLE OF tline WITH HEADER LINE.
    *  DATA l_lines1 TYPE TABLE OF solix_tab WITH HEADER LINE.
      DATA l_docs TYPE TABLE OF docs.
      DATA len TYPE i.
      CALL FUNCTION 'CONVERT_OTF_2_PDF'
        IMPORTING
          bin_filesize           = len
        TABLES
          otf                    = job_output_info-otfdata[]
          doctab_archive         = l_docs[]
          lines                  = l_lines[]                          "this inner table include pdf file data
        EXCEPTIONS
          err_conv_not_possible? = 1
          err_otf_mc_noendmarker = 2
          OTHERS                 = 3.
      *CALL METHOD cl_gui_frontend_services=>gui_download
      *  EXPORTING
      *   bin_filesize = len
      *    filename     = 'c:\pdf.pdf'
      *    filetype     = 'BIN'
      *   CHANGING
      *    data_tab     = l_lines[]"i_objbin[]
      *  EXCEPTIONS
      *    OTHERS       = 1.
    "If i want to save it in my PC ,call this FM CALL METHOD cl_gui_frontend_services=>gui_download.
    But i dont want to do it.I want to pass the parameter l_lines[] to java(web) by RFC, and convert to pdf file and show in java(web).
    thanks
    Freddy

    Hi,
    Update:
    I have tested this and here is some code:
    SAP:(I got the OTF from CALL FUNCTION 'PRINT_TEXT')
    FORM get_pdf_data
      USING
        tdname TYPE thead-tdname
      CHANGING
        it_tline TYPE text_line_tab
        bin_file TYPE xstring .
      DATA: st_thead TYPE thead .
      DATA: it_lines TYPE tline_tab .
      st_thead-tdobject = 'TEXT' .
      st_thead-tdname   = tdname .
      st_thead-tdid     = 'ST' .
      st_thead-tdspras  = 'E'  .
      CALL FUNCTION 'READ_TEXT'
        EXPORTING
          id                      = st_thead-tdid
          language                = st_thead-tdspras
          name                    = st_thead-tdname
          object                  = st_thead-tdobject
        IMPORTING
          header                  = st_thead
        TABLES
          lines                   = it_lines
        EXCEPTIONS
          id                      = 1
          language                = 2
          name                    = 3
          not_found               = 4
          object                  = 5
          reference_check         = 6
          wrong_access_to_archive = 7
          OTHERS                  = 8.
      IF sy-subrc NE 0 .
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4 .
      ENDIF.
      DATA: it_otfdata TYPE otf_t_itcoo .
      DATA: st_options TYPE itcpo.
      st_options-tdgetotf = abap_true .
      CALL FUNCTION 'PRINT_TEXT'
        EXPORTING
          dialog                   = abap_false
          header                   = st_thead
          OPTIONS                  = st_options
        TABLES
          lines                    = it_lines
          otfdata                  = it_otfdata
        EXCEPTIONS
          canceled                 = 1
          device                   = 2
          form                     = 3
          OPTIONS                  = 4
          unclosed                 = 5
          unknown                  = 6
          format                   = 7
          textformat               = 8
          communication            = 9
          bad_pageformat_for_print = 10
          OTHERS                   = 11.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
      DATA: it_otfdata_m TYPE otf_t_itcoo .
    * "Merge pdf output demo"
      APPEND LINES OF it_otfdata TO it_otfdata_m .
    * DATA: bin_file TYPE xstring .
      DATA: it_lines_dummy TYPE tline_tab .
      DATA: bin_filesize TYPE i .
      CALL FUNCTION 'CONVERT_OTF'
        EXPORTING
          format                = 'PDF'
        IMPORTING
          bin_file              = bin_file
          bin_filesize          = bin_filesize
        TABLES
          otf                   = it_otfdata_m
          lines                 = it_lines_dummy
        EXCEPTIONS
          err_max_linewidth     = 1
          err_format            = 2
          err_conv_not_possible = 3
          err_bad_otf           = 4
          OTHERS                = 5.
    ENDFORM.                    " GET_PDF_DATA
    Java:
    final byte[] byteArray = function.getExportParameterList().getByteArray("BIN_FILE");
    final Path path = Paths.get("My.pdf");
    Files.write(path, byteArray, StandardOpenOption.TRUNCATE_EXISTING, StandardOpenOption.CREATE);
    regards.
    Another update:
    Using in HttpServlet:
    import java.io.IOException;
    import javax.servlet.ServletException;
    import javax.servlet.ServletOutputStream;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import com.sap.conn.jco.JCoDestination;
    import com.sap.conn.jco.JCoDestinationManager;
    import com.sap.conn.jco.JCoException;
    import com.sap.conn.jco.JCoFunction;
    import com.sap.conn.jco.JCoRepository;
    import com.sap.conn.jco.ext.Environment;
    import destinations.MyDestination;
    public class MyServlet extends HttpServlet {
    @Override
    protected void doGet(final HttpServletRequest httpServletRequest, final HttpServletResponse httpServletResponse) throws ServletException, IOException {
      httpServletResponse.setContentType("application/pdf");
      httpServletResponse.setStatus(HttpServletResponse.SC_OK);
      final ServletOutputStream servletOutputStream = httpServletResponse.getOutputStream();
      servletOutputStream.write(getPDF());
      servletOutputStream.flush();
      servletOutputStream.close();
    private byte[] getPDF() {
      try {
       Environment.registerDestinationDataProvider(new MyDestination());
       final JCoDestination destination = JCoDestinationManager.getDestination(destinations.Id.sapdev2.name());
       final JCoRepository repository = destination.getRepository();
       final JCoFunction function = repository.getFunction("Y_R_EITAN_TESTS_03");
       function.execute(destination);
       final byte[] byteArray = function.getExportParameterList().getByteArray("BIN_FILE");
       return byteArray;
      } catch (final JCoException exception) {
       exception.printStackTrace();
       return null;

  • Coverting java .class files to .bin files

    Dear all :
    I am in a need to convert a java .class files to binary format file (i.e.) bin i mean an executable files in Linux.
    Is there any possibility using JNI or anyother method to achieve it.
    Please post me your suggestions...
    Thanks in advance
    hope my problem will be solved.
    regards
    silviya

    I can help on this subject, I heard about some
    programs that can convert the .exe files to .bin
    files, so you can go and search for such programs, if
    you hava found them you should go to the following
    URL:
    http://www.ej-technologies.com/products/exe4j/overv
    iew.html
    so you can get the exe4j program which
    can made exe files for Java programs then after
    installing the program you must enter the license key
    and the user name and the company name, user name and
    company name can be anything you want, but the
    license key must be a valid license key here I'm
    giving you one of them and I hope it will work
    successfully: ( A-XVK103616F-3jpbhxrlcljd )
    after that you should declare a .exe file for your
    project in java after that you must use the
    exe2bin program to convert the .exe
    file to a .bin file and I hope that you will be
    successful in your target.
    And I'm ready to help you anytime, cause you seems to
    be a good girl trying hard to learn and be successful
    person in this life.i did as u said n i got a problem after i convert jar file to exe....i can't find any program which can convert .exe file to .bin file can u give me any suggestion

  • How to convert from xml file to html using java code

    How to convert from xml file to html file using java code

    Get yourself Apache Xalan or Saxon or some XSLT processor
    String styleSheet = "/YourXSLTStylesheet.xsl";
    String dataSource = "/YourXMLDocument.xml";
    InputStream stylesheetSource = TransformMe.class.getResourceAsStream(styleSheet);
    InputStream dataSourceStream = TransformMe.class.getResourceAsStream(dataSource);
    OutputStream transformedOut = new FileOutputStream("filename.html");
    TransformerFactory tFactory = TransformerFactory.newInstance();
    Transformer transformer = tFactory.newTransformer(new StreamSource(stylesheetSource));
    transformer.transform(new StreamSource(dataSourceStream), new StreamResult(transformedOut));You'll also need to learn XSLT if you don't already know that. Here's a good place to start
    http://www.w3schools.com/xsl/

  • How to Convert a .class file into exe

    I need to convert a .class file to exe...
    If abybody know ...plz infrom me briefly....
    Thanx a lot

    I do not know.
    I come from china.
    [email protected]
    Is that suppose to be a racial joke?From his other post, I'm thinking he's actually serious. At first I thought it was just a troll, but even that email address looks correct (sina.com is a popular service in China and I don't expect an average troll to do 'research' like that).

Maybe you are looking for

  • My CD DVD drive cant be found. It did work, now it doesnt.

    Need help with my CD DVD not being detected.

  • Printing html text and font styles

    Hello, when I try to print html text in serif with italic or bold text style the output on a printer incorrectly shows the bold and italic parts in arial or something. Underlined text is printed correctly. The font is rendered correctly on a JEditorP

  • Is email address significant as an identifier

    I downloaded and set-up Digital Editions under one email address and bought a ebook, that I cannot seem to access, under a different email address. Do the email addresses need to be the same? AND, if so - How do I change the email in the authorizatio

  • Notebook with sim-slot

    Dear every1! Is there any way in java se to get some kind of cellular/networking information with the built in sim-card or with the pluggable sim-card (pendrive-like simcard)? I know how this works with java me, so... if javase does not support it, t

  • What is the customer service

    What is the customer service phone number for creative in the US. I am located in CA, and cant find the phone suppoet on their website