Results 1 to 10 of 10
Thread: Editing .class files
- 01-30-2012, 08:04 AM #1
Member
- Join Date
- Nov 2011
- Posts
- 14
- Rep Power
- 0
Editing .class files
I have a couple of executable jar files that are filled with a bunch of .class files. These 2 jars are included as libraries in the java build path of the project.
I want to edit those .class files inside those jars. Even after I unchecked read only, I still cannot edit them in Eclipse. I can open them, but nothing happens when I type. Is it possible to edit those somehow?
Thanks.
- 01-30-2012, 08:25 AM #2
Re: Editing .class files
What do you expect to achieve by editing the bytecode?
dbWhy do they call it rush hour when nothing moves? - Robin Williams
- 01-30-2012, 08:39 AM #3
Member
- Join Date
- Nov 2011
- Posts
- 14
- Rep Power
- 0
Re: Editing .class files
I want to change a bunch of JOGL 1 import statements to JOGL 2.0 equivalents and see if the code still works.
I mean I see all the code inside each .class in eclipse, just can't change it.
- 01-30-2012, 11:37 AM #4
Re: Editing .class files
Import statements don't exist in a .class file. They are just semantic sugar that saves you the trouble of having to specify the fully qualified class name every time it is used.
Whatever you're seeing, it's not imports.
If JOGL 2.0 is 100% backward compatible with earlier versions, I think you should be able to change which version your program uses by manipulating their availability on the classpath.
dbWhy do they call it rush hour when nothing moves? - Robin Williams
- 01-30-2012, 11:39 AM #5
Member
- Join Date
- Nov 2011
- Posts
- 14
- Rep Power
- 0
Re: Editing .class files
Yeah I sort of figured it took some sort of decompiler and wasn't about to mess this that since I have the source files for those jars. JOGL 2.0 is not backward compatible though. Anyone has ever gone through an exercise of getting through that?
- 01-30-2012, 11:47 AM #6
Re: Editing .class files
If you have the source files, why are you even thinking about editing .class files?
dbWhy do they call it rush hour when nothing moves? - Robin Williams
- 01-30-2012, 11:50 AM #7
Member
- Join Date
- Nov 2011
- Posts
- 14
- Rep Power
- 0
Re: Editing .class files
Didn't know where they were at the time.
- 01-30-2012, 11:55 AM #8
Re: Editing .class files
Ah, ok. Problem solved then?
dbWhy do they call it rush hour when nothing moves? - Robin Williams
- 01-30-2012, 11:56 AM #9
Member
- Join Date
- Nov 2011
- Posts
- 14
- Rep Power
- 0
Re: Editing .class files
I'd say so. Thanks.
- 01-30-2012, 11:58 AM #10
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,606
- Blog Entries
- 7
- Rep Power
- 17
Re: Editing .class files
Eclipse is quite clever when it comes to showing a .class file to a user: if it can find the source of that file it shows the source as a read only file; if it can't find any source, it partly decompiles the .class file (as javap -c would) and shows that, also as a read only file.
kind regards,
JosWhen people rob a bank they get a penalty; when banks rob people they get a bonus.
Similar Threads
-
Editing text files
By NickBru in forum New To JavaReplies: 4Last Post: 12-05-2010, 06:27 PM -
*.class-files
By artemff in forum New To JavaReplies: 3Last Post: 12-31-2009, 08:38 PM -
conversion of java .class files to .java files
By kotturupraveen in forum New To JavaReplies: 2Last Post: 06-09-2008, 12:58 PM -
'class' and 'jar' files
By ai_2007 in forum Advanced JavaReplies: 1Last Post: 06-29-2007, 03:11 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks