I'm trying to run Google's Closure Compiler on my server (CentOS 6). I installed it, but only got errors when I tried to run it.

java.lang.NoSuchMethodError: method java.util.regex.Pattern.quote with signature (Ljava.lang.String;)Ljava.lang.String; was not found. (Closure::Error)
   at com.google.javascript.jscomp.RhinoErrorReporter.replacePlaceHolders(RhinoErrorReporter.java:68)
   at com.google.javascript.jscomp.RhinoErrorReporter.<init>(RhinoErrorReporter.java:74)
   at com.google.javascript.jscomp.RhinoErrorReporter.<init>(RhinoErrorReporter.java:32)
   at com.google.javascript.jscomp.RhinoErrorReporter$OldRhinoErrorReporter.<init>(RhinoErrorReporter.java:143)
   at com.google.javascript.jscomp.RhinoErrorReporter$OldRhinoErrorReporter.<init>(RhinoErrorReporter.java:139)
   at com.google.javascript.jscomp.RhinoErrorReporter.forOldRhino(RhinoErrorReporter.java:108)
   at com.google.javascript.jscomp.Compiler.<init>(Compiler.java:151)
   at com.google.javascript.jscomp.CommandLineRunner.createCompiler(CommandLineRunner.java:755)
   at com.google.javascript.jscomp.AbstractCommandLineRunner.doRun(AbstractCommandLineRunner.java:693)
   at com.google.javascript.jscomp.AbstractCommandLineRunner.run(AbstractCommandLineRunner.java:334)
   at com.google.javascript.jscomp.CommandLineRunner.main(CommandLineRunner.java:871)

It seems I'm running GIJ instead of Oracle's Java, so I think that could be causing my problems. (Or maybe not, feel free to correct me if this isn't likely.) How do I remove GIJ and install Oracle Java in it's stead?

I did the obvious: Downloaded the RPM from Oracle, and ran rpm -Uvh jre-7u5-linux-x64.rpm as root. Ran java --version and it's still GIJ.

I've been Google for half an hour now, but haven't found anything helpful.


Run alternatives --config java and select the Oracle version.

  • Only GIJ shows up. – Theron Luhn Jul 9 '12 at 20:28

Find the package you want yum search java and/or yum provides java. In my case it was java-1.7.0-openjdk.x86_64, and then:

yum install java-1.7.0-openjdk.x86_64

Remove the unwanted version with yum remove

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.