简体   繁体   中英

can you create java file from the class file? Decompile

I recently created a project in Netbeans using VirtualBox on which i installed windows XP (Not activiated) My Windows required me to activate and would not allow me access to my files on the computer before i activate it, i stupidly went and uninstalled XP and reinstalled it, thinking i'll have access to all the files from the JAR file i created

I want to know if theres any way i can use the class files of the project i created, to create new java files so that i can edit the code in netbeans ??

Please if anyone can shed some light on this topic, if its at all posible to gain access to the forms java content i created. Im new to programming and this is something above my knowledge (i hope this makes sense)

If not possible please let me know what an absolute idiot i am, so that i can start re creating the project from scratch ... Sigh, and thank you

A jar/class file is compiled bytecode that is not human-readable... but with Java it is easily converted back. Look into a program like JavaDecompiler . 1 This is not my program but I use it and I find it workable for my needs.

1 If this is considered spam I'll gladly invalidate the link.

As a sidenote: You are lucky that its Java. In many other languages like C++ that would hardly be possible. The difference is that Java does not compile the source code to machine code . That step is hardly reversible since for example all variable names are lost. Try to understand a non-trivial piece of code without helpful variable names...

Java instead compiles the source code to byte code which then is interpreted by Java on runtime. That byte cold holds way more information about the original source code than machine code.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM