Chris wrote:
> We've written an app that depends on the regex capability in JDK 1.4, and
> now the app has to run under 1.3. Rather that do a rewrite to use another
> regex package, I extracted the java.util.regex.* classes from 1.4 and put
> them in their own .jar. If I put that .jar on the classpath, then
> everything compiles fine under 1.3. When I try to run the app, though, I
> get this error message:
>
> java.lang.SecurityException: Prohibited package name: java.util.regex
>
> I suppose I could change the package names in the regex source code and
> recompile, but I'd rather not, because then I'd have to distribute this
> new jar file, even when deploying under 1.4 or 1.5.
>
> Any thoughts on how to solve this problem?
First of all, what you did was probably against the terms of your license,
you just can't take random pieces out of a JRE.
Instead of trying to take out the 1.4 regex classes, use another regex
package, like one of these:
http://jakarta.apache.org/regexp/
http://jakarta.apache.org/oro
Porting your code to use one of these shouldn't be too much work.
--
Kind regards,
Christophe Vanfleteren