Junilu Lacar wrote:I'm pretty sure there are a lot tools already out there that can do that. Are you working on Yet Another Java Decompiler then?
Junilu Lacar wrote:
sanyam Goel wrote:
I have a question regarding java class loading. Can any one kindly suggest me a solution in case I want to load a java application through a custom class loader should i use a single loader or multiple loaders and why?? . Another question is in case I have non class files in my java application and I would like to load them how should I attempt this??
Using class loaders is a fairly advanced topic and not many people have to mess with that sort of thing. I have been developing in Java professionally for over a decade and have not once had the need to mess with class loaders, much less custom class loaders. What exactly are you trying to do that you need to mess with class loaders?
Regarding loading of non-class files, it depends on the kind of files you are talking about but they definitely can't be "loaded" using a class loader.
Jesper de Jong wrote:It's not possible to find out what method started a thread by looking at the stack trace from within the thread.
Each thread has its own stack, and starts with an empty stack. The run() method is one of the first things on the stack.
Suppose that thread A creates and starts a thread B. Both threads will have their own, independent stacks. On the stack of thread B you will not find the method of thread A that started thread B.
Darryl Burke wrote:You're using a String as an intermediary for binary data. That's just plain wrong. And in any case, the tostring() method of FileInputStream is inherited from Object -- what made you think that would return the content of the File?
You need to read the FIle into a byte array and use that to define the class. Also, is the 'classFilename' going to be the same as he expected binary name of the class? Think about it.
Maneesh Godbole wrote:Welcome to the Ranch.
This message usually indicates that you used a higher java version to compile the code, than the java version you are using to run it.
Rob Spoor wrote:I don't think so. The error message for that is different: "unsupported class version". This one does mean that there's something wrong with the class files. Can you show us how you create a byte from the class file?