LWN.net Logo

Java and Memory Protections

Java and Memory Protections

Posted Dec 3, 2006 12:54 UTC (Sun) by fjalvingh (guest, #4803)
In reply to: Java and Memory Protections by ttfkam
Parent article: Virtual Machines and Memory Protections

You are both right. A ClassLoader is used to create the class. But the classloader used for Applets (which is a a standard one) indeed merely loads a stream of bytes and instantiates these as a Class using a ClassLoader base method [ Class defineClass(String name, byte[] b, int off, int len)].

In Java it is trivial to write and execute your own byte code from within a program; whole libraries exist to help you doing it (BCEL, ASM). I used this extensively in many programs to speed up scripting stuff or parameterized logic by compiling it into a class (which will then be JITted by the Java runtime).

Anyway, the fact that Java code can do that has nothing to do with the article's subject which has to do with actual executable content for a system processor...


(Log in to post comments)

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds