harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Geir Magnusson Jr." <g...@pobox.com>
Subject Re: Adds: [general] Dynamic class loading
Date Sat, 07 Oct 2006 08:12:51 GMT
I wonder if it would be something cool for Apache Jakarta Commons?

geir


Nikolay Chugunov wrote:
> This tool will not require modification of any code of existing VMs and
> should works on any JDK. java.system.class.loader system property should
> exists in any JDK (see
> http://java.sun.com/j2se/1.5.0/docs/api/java/lang/ClassLoader.html#getSystemClassLoader

> 
> ).
> 
> 
> 
> I have not found any similar tool in internet. JSP can't be used: because
> web server should be run, JSP has different syntax and semantics, JSP has
> different versions, need to use java compiler, etc.
> 
> 
> 
> I think this tool may be very simple to implement, because many lines of
> code have been already written: it is URLCLassLoader.
> 
> 
> 
> What do you think about separate tool in Apache?
> 
> 
> 
> Nikolay Chugunov
> 
> Intel Middleware Products Division
> 
> 
> 
> ---------- Forwarded message ----------
> From: Nikolay Chugunov <nikolay.chugunov@googlemail.com>
> Subject: [general] Dynamic class loading
> To: harmony-dev@incubator.apache.org
> 
>  From the beginning of learning Java and till now I hate to compile java
> source code before run it. I propose to develop easy solution for this
> problem: compile java sources on fly.
> 
> Command to do it can look like:
> 
> 
> 
> java –cp …:mytool.jar
> -Djava.system.class.loader=classloader.MyClassLoaderHelloWorld
> 
> 
> 
> When executing any application, if MyClassLoader does not find compiled
> class in class path, it will try to find file-source of this class with 
> java
> extension in class path. If MyClassLoader finds this file, then
> MyClassLoader will compile source on fly and load class to MyClassLoader
> using *defineClass* method.
> 
> 
> 
> The second improvement which I propose to develop is to load jar file from
> internet, if user specify URL to jar file in command line.
> 
> 
> 
> MyClassLoader may cache compiled classes and loaded jars. MyClassLoader may
> use standard and Eclipse compiler to compile sources. Also MyClassLoader 
> may
> compile on fly other sources (like Jasmin). The base of my tool will be
> existing URLClassLoader in Harmony.
> 
> 
> What do you think about my proposals?
> 
> Nikolay Chugunov
> 

---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Mime
View raw message