• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Editing compiled Java files

 
Cody Lee
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This might sound stupid, but I do not know how to edit files after I have compiled them into a Java file. Help please?
 
Tom Reilly
Rancher
Posts: 618
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Java files are compiled into class files. As far as I know, the only thing you can compile into Java files are JSP files. Can you elaborate your question?
 
Thomas Young
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Cody,
Welcome to the Java Ranch.

When you compile, you are turning the source code into a bytecode class file.

You would have started with a file with a .java extension, this is your source code.

After you have compiled a source code file, you will be left with two files: a compiled class file (.class) and the original source code (.java) that you used to create the class.

It would be much easier for you to modify the source code and then recompile the source code, than to modify the executable.

If you wanted to modify the executable, the compiled class file would need to be decompiled if you needed to edit it. There are tools available do this. Try Goolgeling "Java Decompilers". But I would strongly recommend that you go with modifying the original source.

Regards,
TY.
 
Cody Lee
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok thank you
 
Tom Reilly
Rancher
Posts: 618
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
EDIT: This was a response to your response that you edited, so really doesn't make sense anymore

Do you mean the error is displayed when you double click on the java file? If so, this is a problem with the configuration on your Wndows box. You haven't associated files with the .java extension with an application that will load it. Pick Notepad (or your favorite text editor) and you'll be able to open the file.
 
Vijitha Kumara
Bartender
Pie
Posts: 3918
10
Chrome Fedora Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tom Reilly wrote:... As far as I know, the only thing you can compile into Java files are JSP files ...

It's a translation. Putting the things in the right place(s) from the JSP in a file which to become a Java source file to be compiled.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic