You may got the error something similar in this format when you try to run Apache Geronimo with ./geronimo run
\Java\jdk1.6.0_17\jre) was unexpected at this time
\Java\jdk1.6.0_75\jre) was unexpected at this time
\Java\jdk1.7.0_55\jre) was unexpected at this time
This is likely a known problem with the “parenthesis” character handling in Geronimo batch file. You have have a Windows machine, which installs the 64 bit applications under C:\Program Files and 32 bit applications under C:\Program Files (x86), and your JAVA_HOME or JRE_HOME is probably set to the Java library in C:\Program Files (x86).
So, how do you solve the problem without changing the default version of Java? The easiest solution is simply to set JAVA_HOME variable inside geronimo.bat file. Follow the steps to run the Geronimo with a Java version installed under Windows 32 bit folder (Program Files (x86)).
STEPS TO FOLLOW:
Locate the directory where you installed your Apache Geronimo. Locate the folder called bin, which has the different batch files including geronimo.bat and shutdown.bat. geronimo.bat file is what we are looking for.
Open the file with the text editor of your choice.
You will see a bunch of batch scripts. On the top, right after the last comment @REM———– , introduce the following line:
where C:\Progra~2 is something called Windows short name and interprets to Program Files (x86). Basically, it is saying “this is the second directory with the same starting with the prefix Progra“. With this logic, C:\Progra~1 will be C:\Program Files.
And replace jdkx.x.x._xx with whatever JDK version that you are referring to under C:\Program Files (x86).
Thus, you have something similar to the screeshot below:
What is going to happen is that JAVA_HOME is going to temporarily set to the JDK path you specify above. geronimo.bat file is going to look for JRE_HOME first. If not found, it is going to look for JAVA_HOME and set as the JDK to run.
Save the file and close it.
Run geronimo.bat in your command console (Windows cmd, Windows Powershell, or Cygwin). And you should have Geronimo successfully run in your environment!