Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Will it be possible to use Java 8 on Glassfish 3?

We currently use Glassfish 3 and I really want to use Java 8. I tried upgrading to Glassfish 4, but I experienced two bugs in the Glassfish 4 code so I had to revert back to Glassfish 3. Will Glassfish 3 work with Java 8 or will I have to upgrade my application container?

like image 889
Daniel Kaplan Avatar asked Mar 17 '14 18:03

Daniel Kaplan


People also ask

What JDK does GlassFish support?

Required JDK Versions Eclipse GlassFish Server Release 5.1 requires Oracle JDK 8 Update 144 or later.

Why is Java 8 used?

Java 8 includes features for productivity, ease of use, improved polyglot programming, security and improved performance. Welcome to the latest iteration of the largest, open, standards-based, community-driven platform.


2 Answers

No, it won't be possible (at the moment, maybe a workaround will occur later).

I tried Glassfish 3.1.1 and Glassfish 3.1.2.2 with the final Java 8 JDK which was released today. It doesn't even start the server, some OSGI exceptions are thrown.

As the comment to your question showed, it doesn't even work with earlier builds of Glassfish 4.0.

Update 2015:

It looks like there is a way to make it work with Glassfish 3.1.2.2.

Open the file /glassfish/domains/domain1/config/osgi.properties of your Glassfish installation and add the following line at the end of the file: jre-1.8=${jre-1.7}

This should make the server start with JDK 8. It still doesn't work for Glassfish 3.1 or 3.1.1.

See also:

  • JDK-8020071 Unable to start Glassfish 3.1.1. with JDK 8
  • GLASSFISH-19363 GF fails to start on jdk8
like image 145
unwichtich Avatar answered Sep 21 '22 23:09

unwichtich


Stopped by an error after upgrading my Java 7 to Java 8. Glassfish 3.1.2.2 just won't start.

Found a solution:

edit osgi.properties file in the glassfish/config folder and add this line at the end:

jre-1.8=${jre-1.7} 
like image 34
max Avatar answered Sep 25 '22 23:09

max