• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

.class file problem

 
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i have .class file which is compiled on solaris with may be different version of jvm.

i have decompiled the .class file on windows using decompiler
when i try to complie this file again using jvm 1.4 .6 on windows i get compilation errors.

what can be the reson for this...i hope this is not enviornment problem...

please help me out!!!
 
Ranch Hand
Posts: 547
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
what are the compiler errors ?

there are a lot of things that can go wrong.... but perhaps you are missing required classes (classes that are referenced by the class you decompiled)

and by the way: you do not compile with the JVM.... but with the java compiler...


pascal
 
Ranch Hand
Posts: 824
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes , It's not the matter you are compiling on different OS.
With decompilation , many things can go wrong, Like missing class related to the class you are decompiling. And if the compile file itself has been compiled from the source which actually applied algorithm for preventing it from decompilation. And some factors may also there..

Post here what errors you are getting when compile
 
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i don't think . decompiler will give the exact code back to you. it will give just pseudocode to my knowledge.

decompiler is used to just get some knowledge on the class and not for reusing it. if i am wrong, correct me
 
Sunil Kumar Gupta
Ranch Hand
Posts: 824
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by thisisnaveen:
i don't think . decompiler will give the exact code back to you. it will give just pseudocode to my knowledge.

decompiler is used to just get some knowledge on the class and not for reusing it. if i am wrong, correct me



Did You ever use any decompiler. I have used many times, And most of the time it gives me the right source code. Format may be change, But it's completely reusable.

Try experimenting your own source files.
 
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi everyone...thanx for your help...i am sorry...for jvm and java comppiler mistake...well i have observed following things and need your suggestions

class file having innerclass doesnt decompile properly....

the errors i am geeting are like 2 syntax errors where extra ,or. is there and goto statement is used ..which is not actually present in program..

so please let me know the solutions for above problems
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, clearly the decompiler you're using doesn't handle inner classes (or at least some inner classes) correctly. Given then you haven't told us what decompiler you're using, it's unclear what you think we could do for you that you can't do for yourself: make sure you're using the latest version of whatever tool you're using, then read its manual, carefully, to find out what its limitations are.
 
Sunil Kumar Gupta
Ranch Hand
Posts: 824
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by alwin das:

class file having innerclass doesnt decompile properly....



It decompiles inner class properly. All you need to do is to get the inner class file which will be some file$1.class or file$2.class. Download these files too from where you downloaded main class file.and you dont need to decompile these files. You need to put these files on the same directory where you are decompiling your main class file. and then decompile your main class file. And you will get those inner classes in your source.



the errors i am geeting are like 2 syntax errors where extra ,or. is there and goto statement is used ..which is not actually present in program..



This is the general problem happens with decompiler. Actually it's not the fault of decompiler. The one who created the source have applied some algorithm to prevent his source code from decompiling. What these algorithm does. It simply causes decompiler to generate the wrong source code. Extra thing which you would never expect in any of your java source files.

Well, follow the step one i said and you will get your inner class.


reply
    Bookmark Topic Watch Topic
  • New Topic