9 Replies Latest reply: Oct 29, 2009 5:44 AM by 843790 RSS

    Write Class object to .class file

    843790
      I need to write Class object to .class file. The Class object is dynamic.

      This topic alreeady was discussed, but I cant find the solution from it:
      http://forums.sun.com/thread.jspa?forumID=62&threadID=167908

      Please help :)
        • 1. Re: Write Class object to .class file
          843790
          There are plenty of solutions in that thread with plenty of possible drawbacks.

          Which ones have you tried and why are they not suitable for you?
          • 2. Re: Write Class object to .class file
            843790
            I didnt find any solution, I tryied to play with BCEL and JOIE, but unsuccesfully. Maybe becouse I am not expert at those product, maybe this becouse this is cant be done with those products.
            Jikes Bytecode Toolkit - from IBM - I cant download, seems that this product is dead.

            So big thanx to any, which can help me with the solution
            • 3. Re: Write Class object to .class file
              843790
              Boccob1 wrote:
              I didnt find any solution, I tryied to play with BCEL and JOIE, but unsuccesfully.
              That's not really very helpful. If you can't tell us what exactly went wrong or what problems you encountered we can't tell you how to overcome them, can we?

              Please read [How To Ask Questions The Smart Way|http://www.catb.org/~esr/faqs/smart-questions.html].
              Maybe becouse I am not expert at those product, maybe this becouse this is cant be done with those products.
              If you're not an expert in this, then you should probably stay far away from it anyway. It's not a trivial matter and chances are there's a much easier solution to what you want to achieve.

              What goal do you want to achieve with this? Why do you think you need to do this?
              • 4. Re: Write Class object to .class file
                843790
                The problem is clearly indetified, so please dont be demagogue. This is question - you know or you dont know.
                • 5. Re: Write Class object to .class file
                  843790
                  Boccob1 wrote:
                  The problem is clearly indetified
                  No, it is not. It is ill-defined and you can't give us a reason why you want to do it. There are very few valid reasons to do this kind of stuff. That's why I (and others in the other thread) are not certain that the need is indeed there.
                  , so please dont be demagogue.
                  You do know that you're given help here for free, do you? I just want to make sure that I don't help build a overly-complicated, fragile "solution" to a problem that doesn't exist.
                  • 6. Re: Write Class object to .class file
                    EJP
                    I need to write Class object to .class file. The Class object is dynamic.
                    How is it dynamic? Where did it come from? how was it created?
                    • 7. Re: Write Class object to .class file
                      843790
                      ejp wrote:
                      I need to write Class object to .class file. The Class object is dynamic.
                      How is it dynamic? Where did it come from? how was it created?
                      I bet 100 duke dollars that he simply meant "not known at compile time" and that the class is not actually generated at runtime.
                      • 8. Re: Write Class object to .class file
                        843790
                        The reason is valid, please be sure and trust me. I dont want to write specifications for several pages - it will takes more hard understanding to others.
                        The problem that I have ONLY generated Class object in runtime, but I need to save it to the class file.

                        Edited by: Boccob1 on Oct 29, 2009 3:46 AM
                        • 9. Re: Write Class object to .class file
                          EJP
                          Please answer my questions.