some puzzles about Openjdk
Liu lianshun
lsliu0507 at gmail.com
Wed Apr 8 14:16:38 UTC 2009
Hi, Dalibor Topic
Thanks very much for your reply.
My first question is that, I want to change the java application's behavior, in the other words, manipulate the bytecodes of some class when running the application without changing the class file itself. Is it possible? Can this be done via hacking on the VM, and how? Thanks :)
Bestwishes
Lianshun Liu
----- Original Message -----
From: "Dalibor Topic" <Dalibor.Topic at Sun.COM>
To: "Liu lianshun" <lsliu0507 at gmail.com>
Cc: <build-dev at openjdk.java.net>
Sent: Wednesday, April 08, 2009 9:03 PM
Subject: Re: some puzzles about Openjdk
> Liu lianshun wrote:
>> Firstly, I want to know that whether I can change the java programes'
>> behavior via changing some source files in OpenJDK, for examples,
>> execute the following codes will print "100".
>> int i=100;
>> System.out.println(i);
>> My question is that how to print "200", without changing the source
>> codes. Is it possible?
>
> Is it possible to change behavior of programs by changing the
> source code of OpenJDK? Yes. You can make them all crash
> very fast by doing something bad in the VM for example. ;)
>
> Is it possible to change behavior of programs without changing the
> source code of OpenJDK? Yes, check out aspect oriented programming
> using, for example, AspectJ.
>
>> Secondly, the number of files in the OpenJDK project is very large, I
>> want to know how these files are structured. Besides, how can I debug
>> the project?
>
> Volker Simonis wrote a couple of blog entries on how to get started hacking
> on the VM, starting with:
>
> http://weblogs.java.net/blog/simonis/archive/2008/01/hotspot_develop.html
>
> have fun!
>
> dalibor topic
>
> --
> *******************************************************************
> Dalibor Topic Tel: (+49 40) 23 646 738
> Java F/OSS Ambassador AIM: robiladonaim
> Sun Microsystems GmbH Mobile: (+49 177) 2664 192
> Nagelsweg 55 http://openjdk.java.net
> D-20097 Hamburg mailto:Dalibor.Topic at sun.com
> Sitz der Gesellschaft: Sonnenallee 1, D-85551 Kirchheim-Heimstetten
> Amtsgericht München: HRB 161028
> Geschäftsführer: Thomas Schröder, Wolfgang Engels, Dr. Roland Bömer
> Vorsitzender des Aufsichtsrates: Martin Häring
>
>
More information about the build-dev
mailing list