Jump to content
xisto Community
Sign in to follow this  
LooneyMapleStory

Java De/compiler

Recommended Posts

Hey I'm currently using Netbeans as my Compiler and jd-gui as my decompiler I want to know if there is anything more effective when i use jd-gui is messes up the source code and deletes the @overrides and comment outs

Share this post


Link to post
Share on other sites

I don't have much experience in this area, but I think cavaj is good. Har har, it's java-c backwards.Also, do comments even stay in the code when you compile..? Unless you mean something else =\

Share this post


Link to post
Share on other sites

Well yes the documents do stay in the .jar when i compile the only issue is that from the .java extension the file turns into a .class file.but a .jar is just a compressed zip file with the class files in them meaning, when a java file is compiled the compiled version of the file is a .class and when it is compiled as a project it is saved in a compressed .jar file in which all of the .class files are, you can use winRAR to unzip the .jar but you're only going to get .class files which are just the compiled version...

Share this post


Link to post
Share on other sites

Hey I'm currently using Netbeans as my Compiler and jd-gui as my decompiler I want to know if there is anything more effective when i use jd-gui is messes up the source code and deletes the @overrides and comment outs

It may be that 'javac' removes all comments by default when you compile your source files to make your files more compact.

It may also be that the NetBeans IDE either removes comments from the code prior to compilation in an effort to optimize or it runs a custom code obfuscator on your class files following compilation.

Obfuscation is a type of security measure employed by developers who want to prevent their proprietary source code from being easily understood if de-compiled. They usually strip your code of comments, change the names of variable references on the symbol table so that they are practically unfathomable and scramble the formatting of the code to make it difficult for prying eyes to decipher (without messing with your code's logic). If obfuscation is the case then NetBeans may have some option setting somewhere that disables it.

You could try compiling your source from the command-line prompt using 'javac' and see if there is a difference. You may need to locate the '\bin' sub-folder in the folder where your JDK files are installed (usually 'C:\Program Files\Java\jdk\bin' ) to run 'javac'. I would also suggest that you set the folder in your system path (if it's not there already), that way you can run 'javac' and 'java' from any instance of a command-line prompt...
Edited by dimumurray (see edit history)

Share this post


Link to post
Share on other sites

It may be that 'javac' removes all comments by default when you compile your source files to make your files more compact.
It may also be that the NetBeans IDE either removes comments from the code prior to compilation in an effort to optimize or it runs a custom code obfuscator on your class files following compilation.

Obfuscation is a type of security measure employed by developers who want to prevent their proprietary source code from being easily understood if de-compiled. They usually strip your code of comments, change the names of variable references on the symbol table so that they are practically unfathomable and scramble the formatting of the code to make it difficult for prying eyes to decipher (without messing with your code's logic). If obfuscation is the case then NetBeans may have some option setting somewhere that disables it.

You could try compiling your source from the command-line prompt using 'javac' and see if there is a difference. You may need to locate the '\bin' sub-folder in the folder where your JDK files are installed (usually 'C:\Program Files\Java\jdk\bin' ) to run 'javac'. I would also suggest that you set the folder in your system path (if it's not there already), that way you can run 'javac' and 'java' from any instance of a command-line prompt...

Ahah I got it =D Thanks for all of the help this is what i did, I made a Batch file with the java extensions and then put the path file of the .jar and it worked flawlessly! Thanks once again and have a great day!

Share this post


Link to post
Share on other sites

Ahah I got it =D Thanks for all of the help this is what i did, I made a Batch file with the java extensions and then put the path file of the .jar and it worked flawlessly! Thanks once again and have a great day!

You're welcome :P...However I can't say I'm sure as to what you actually did :) It sounds as if you ran the code from the command-line and I am also assuming that you set the path in the batch file...but did you try setting the path globally via [ Control Panel->System->Advanced->Environment Variables ] ...that way you wouldn't have needed to write a batch file...Still I am curious about one thing...Do you have to run the batch file every time or is there someway to setup your environment so that it runs automatically every time? Edited by dimumurray (see edit history)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.