JAVA - .jar Apps Run Slow?

Hi, I am trying to run a .jar application on my raspberry Pi2 with Ubuntu Mate 16.04 but the app runs extremely slowly.

What version of Java is pre-installed ? How can I remove it and instead install Oracle Java which is said to work much better ? Would this have any affect on day to day system performance ?

Thanks

Hi @rph, you can find out which Java version are you running with the command java -version, probably you should have OpenJDK.

Hi, the version of Java is shown as this:

It is what came pre-packaged as part of the installation. Someone said that I should remove the "Zero" variant. I read somewhere that Oracle Java is pre-installed as part of Raspbian image so I thought it was maybe the same for Ubuntu Mate. Maybe it is not included with the Pi2 image.

@cclaw I noticed you edited your post. Should I use a different method for installing Oracle Java ? I'm also not sure how I should go about removing the currently installed variant.

I’m sorry I didn’t notice that you have Ubuntu MATE Raspberry pi, I’m not an expert on such topics, that ppa that I suggested you don’t support your architecture. You have to download it directly from Oracle site and place it in your system, here is a good explanation how to do that from Raspberry pi StackExchange. Once you have installed it you don’t have to remove OpenJDK, you could keep two different jdks and choose the default one with sudo update-alternatives --config java

I’m still a bit confused as to why on some forums they make it sound so easy to install just by using the command:

sudo apt-get install oracle-java8-jdk

and on others the process is a bit more involved like the one you linked.

If I were to install Oracle version then I don’t see much need to keep the other variants. Do you know how I could purge the other variants from my system ?

Thanks

If you find OpenJDK installed by defaul I suggest you to keep it, but if you want to delete it you could try to do sudo apt-get purge openjdk-8-jdk. The differences on the various installation methods I think that is due to the operating system installed on the machine. I noticed that the Raspbian OS has the Oracle JDK in its repository, so in that OS you could simply do sudo apt-get install oracle-java8-jdk. Ubuntu MATE Raspberry pi doesn’t have it so you have to download it from the Oracle site.

Oh right that makes sense thanks. Pity something similar hasn’t been added to Ubuntu Mate yet…