Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Using java.util.regex in JDK 1.3

Reply
Thread Tools

Using java.util.regex in JDK 1.3

 
 
Chris
Guest
Posts: n/a
 
      11-15-2004
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?


 
Reply With Quote
 
 
 
 
Christophe Vanfleteren
Guest
Posts: n/a
 
      11-15-2004
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
 
Reply With Quote
 
 
 
 
Chris
Guest
Posts: n/a
 
      11-15-2004
> 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.


I came to the same conclusion. ORO seems to work pretty well, and the port
doesn't seem very difficult (so far).


 
Reply With Quote
 
sks
Guest
Posts: n/a
 
      11-16-2004

"Chris" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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


That's because you're not allowed to name your packages java.*


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
JDK 1.5 or JDK 1.6 Pep Java 19 07-15-2007 12:06 AM
regarding JDk 141 and JDK 122 for linux 64 bit Platform Jaggu Java 3 01-08-2007 10:47 AM
What is the difference between J2EE, JDK, JDK-SDK, JRE and J2SE packages ? Ulf Meinhardt Java 0 08-10-2006 07:12 PM
jEdit: compiles JDK 1.5.0 ok, but runs JDK 1.4.1 (why?) Thomas G. Marshall Java 5 08-06-2004 04:12 AM
Help with converting IDS from JDK 1.1 to JDK 1.4 Babar Java 1 05-20-2004 09:11 PM



Advertisments