CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2010
    Posts
    1

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

    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 ?

  2. #2
    Join Date
    May 2006
    Location
    UK
    Posts
    4,473

    Re: How do you convert a jar file into a java file, how ?

    A jar file is basically a zip file, so you can change the extension from .jar to .zip and unzip it using standard zip tools. Note you can't create a jar using the reverse of this process as additional files are added during jar creation.

    The reason there are no .java files in the Jar is the author didn't want to supply the source code. The .java files hold the source code and you compile these to create .class files which the JVM runs.

    It is possible to decompile the .class files to recreate .java files and there are free tools available to do this but you must check the software license before doing this so you don't infringe any of the terms. There are also difficulties in decompiling code as depending on how complex the code is, how it was compiled and whether or not it was obfuscated it can be extremely difficult to understand.
    Posting code? Use code tags like this: [code]...Your code here...[/code]
    Click here for examples of Java Code

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured