Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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.

share|improve this question

2 Answers 2

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

share|improve this answer
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

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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