Message255

Author pedronis
Recipients
Date 2001-01-12.12:51:54
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
Hi.

Maybe this was not clear:
clearly the technique does not work in pure java (at least under sun jvm) either.
Consider:

* M.java
public class M {

 public static void main(String[] args) {
        
  String currPath =  System.getProperty("java.class.path");
  String separator = java.io.File.pathSeparator;
  currPath += separator + "jar1.jar";     

  System.out.println(currPath);

  System.setProperty("java.class.path", currPath); 

  try {                
   Class c = Class.forName("C");
  } catch(Throwable e) {
   System.err.println(e);
  }
                                                                                       
 }

}


* C.java (then compiled to C.class, which is put in jar1.jar")
public class C {}


Running java M one gets:
.:jar1.jar
java.lang.ClassNotFoundException: C


Setting classpath after java init has no effect (!).

regards, Samuele Pedroni.
History
Date User Action Args
2008-02-20 17:16:47adminlinkissue228540 messages
2008-02-20 17:16:47admincreate