What java version should I choose? Upgrade to PRO version

Hi,
I was going to upgrade to Pro version on my Ubuntu server and according to the manual I should install min Java 7.
And trough:

sudo apt-get install openjdk-7-jre

But I can’t do that:

sudo apt-get install openjdk-7-jre
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package openjdk-7-jre is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'openjdk-7-jre' has no installation candidate

But I can install openjdk-8-jre or openjdk-9-jre.

So what version should you recommend?

I recommend you to use Java in version 8, because it is the current stable version for production.
Java 9 is not completely finished yet and still in development.
And Seafile Pro does not use any feature of Java 9, so you should be able to use OpenJDK 8 as long as it is supported itself.

I see, I did install OpenJDK9 but I guess I can just stop my server and remove the openjdk9 and then install openjdk8 and then run the server again?

Just doing it like this:
sudo apt-get autoremove openjdk-9-jre

and then do:

sudo apt-get install openjdk-8-jre

or would I break something?

I did try my thing and now when I write java -version I get:

java -version
openjdk version "1.8.0_131"
OpenJDK Runtime Environment (build 1.8.0_131-8u131-b11-0ubuntu1.16.04.2-b11)
OpenJDK 64-Bit Server VM (build 25.131-b11, mixed mode)

I guess I have version 8 now right?

Nope, that should work!

I did try my thing and now when I write java -version I get:

java -version
openjdk version "1.8.0_131"
OpenJDK Runtime Environment (build 1.8.0_131-8u131-b11-0ubuntu1.16.04.2-b11)
OpenJDK 64-Bit Server VM (build 25.131-b11, mixed mode)

I guess I have version 8 now right?

And now when I do the autoremove thing I get:

sudo apt-get autoremove openjdk-9-jre
[sudo] password for xxx:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package 'openjdk-9-jre' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

Jop! Seems right to me.

I’m on reasearch, why my elasticsearch doen#st work anymore. So I lookked into java.

java - version

says:

openjdk version “10.0.2” 2018-07-17
OpenJDK Runtime Environment (build 10.0.2+13-Ubuntu-1ubuntu0.18.04.2)
OpenJDK 64-Bit Server VM (build 10.0.2+13-Ubuntu-1ubuntu0.18.04.2, mixed mode)

Is that the correct java version and does this work with elasticsearch?

Thanks and best regards,
Jochen

I’d recommend installing Oracle JDK 8 for elasticsearch.

1 Like

I´d recommend to never use oracle jdk and use openjdk whenever possible :wink: I dont see a reason to run proprietary code if there is an FOSS alternative.

Openjdk-8-jre is the way to go.

Thanks guys for youtr answers. I switched back to openjdk 1.8 and search function works again!