Thread

Posted on Thu Feb 14 11:56:33 2008 by chrei
A bit confusion on the CLASSPATH configuration option
Hi, Patrick states in the Inline::Java doc about the CLASSPATH configuration option:
This CLASSPATH will only be available through the user classloader. To set the CLASSPATH globally ( +which is most probably what you want to do anyways), use the CLASSPATH environment variable.
and that's exactly where we ran into a problem. In the concrete case all but one part of the software worked well with the CLASSPATH configuration option; the one part which failed was a framework which did not found its classes and debugging into it we found that it just had InlineJavaServer on its classpath. While setting the classpath through the env variable solved it I do not quite understand the constraint here -- what puzzles me most is the term "globally". Now that I realized that there are some subleties connected to that I would be happy about some enlightenment so that I understand why it works this way and not the other way. Thanks ... Christian
Direct Responses: 7115 | Write a response
Posted on Sat Feb 16 23:57:43 2008 by patl in response to 7101
Re: A bit confusion on the CLASSPATH configuration option

Here's how this works. Inline::Java creates a ClassLoader that is used to load the user's code. The idea here was to create "private" workspaces in order to prevent interaction between different user's code (in SHARED_JVM mode) or between the user's code and the Inline::Java core code.

When you use the CLASSPATH environment variable, you set the CLASSPATH for the default Java ClassLoader. If you use the CLASSPATH option, you set the CLASSPATH for the user ClassLoader. For some reason, some code doesn't work well unless it's loaded by the default ClassLoader (unfortunately I'm not proficient enough with respect to ClassLoaders to understand why).

Patrick

Note: If possible, I would appreciate if you would send any further questions regarding Inline::Java to the Inline mailing linst (inline@perl.org) instead of to this forum. I'm not a big fan of CPAN::Forum and I don't think a lot of Inline::Java users read it.

Write a response