Friday, March 27, 2015

How to Run Glassfish 3 on JDK8 /JRE8



  

Have you updated your PC with new Java 8? Are you using glassfish3 because of unstable glassfish 4 or support or any other reason? Now you will face problem as there is no option to run the glassfish 3 on JRE8. If you have earlier JDK too,  you will get  the error of  'Unsupported major.minor version' during the deployment of app with new jar (compiled with newt JDK ). Here is a little trick I have done to do so –
        1) Open the file ‘domain.xml’ located at
${GLASSFISH_HOME}\glassfish\domains\domain1\config

Edit the ‘java-home’ for example replace –
java-home="C:\Program Files\Java\jdk1.6.0_45"
by
java-home="C:\Program Files\Java\jdk1.8.0_40"

        2) Then open the file ‘osgi.properties’ located at

${GLASSFISH_HOME}\glassfish\config
Append the following line at the end –
jre-1.8=${jre-1.7}
        3) Done… run and enjoy :)
You can check your Glassfish’s JDK from- 
 http://localhost:4848/management/domain/version?verbose=true

No comments:

Post a Comment