Need advise with Java installation

After trying again few games in nintendo8.com website still without sound I’m thinking on trying Oracle’s Java for real now. But again, questions aroused…

I had made a thread about this before, but reviving it may not be good, besides I first looked for some info:
http://humairahmed.com/blog/?p=7398
http://tutorialforlinux.com/2013/12/12/how-to-install-oracle-java-jdk-7-on-opensuse-13-1-gnome3-3264bit-easy-guide/
http://tutorialforlinux.com/2013/12/08/how-to-install-oracle-java-firefox-plugin-on-linux-easy-guide/
Quite different to Java SDB, seemingly it’s yet unfixed/outdated…

According to links, I can keep openJDK and use update-alternatives. But IcedTea plugin is still removed. I guess it’s uncompatible with Oracle’s plugin…

  1. If I’m not developer which one should I install, JRE or still JDK?

  2. Is Oracle’s plugin indeed compatible with openJDK as well?

  3. Why are java plugins being unlinked first in the 3rd link above?

  4. When installing plugin locally for Firefox or SeaMonkey -Gecko based-, is ~/.mozilla/plugins really needed to be created? (It doesn’t exist by default). What is ~/.mozilla/extensions directory for?

  5. If I wanted to do system-wide installation, where should I point the symbolic link to, /usr/lib64/mozilla/extensions or /usr/lib64/browser-plugins? Would it work for Firefox as well?

  6. Overall, is that info good to go or should I stick with Tsu2’s scripts?

Oh, and in the other thread it was mentioned that nintendo8’s online games worked with sound in java mode, but without sound in javascript. Could “java mode” be Oracle’s Java and “javascript” openJDK? That would explain it…

By the way, I’ve still remained with the sibling page snessy.com inquiry due to this ugly issue, in case someone could say something:
http://forums.opensuse.org/showthread.php/490577-Doubt-about-Java?p=2587141#post2587141

Recommend - Install the JDK which includes the JRE. If you install the JRE, you <might> miss some components, but if you install the JDK it’s hard to be miss anything.

The SDB is getting very jumbled and disorganized with the various contributions, but on the page I do mention that people should read the Discussion to know if there are some unofficial improvements, this is the page
https://en.opensuse.org/SDB_Talk:Installing_Java

The last section is by me, and it’s still current. Use the scripts I created and you’ll have the JDK (and JRE) for Oracle SE JDK 7 installed in a few seconds with hardly any effort. The section points to the scripts here
https://github.com/putztzu/openSUSE_Oracle_Java_Install

Once you have the JDK installed, you need to execute a line or two to install the web plugin (be sure to uninstall the Iced Tea plugin first). Because the procedure varies slightly for each web browser, I didn’t script this step. The Oracle web plugin instructions are here
http://www.oracle.com/technetwork/java/javase/manual-plugin-install-linux-136395.html

HTH,
TSU

After reading the Oracle web plugin instructions some doubts were actually dissipated, but others arouse…

a) Tsu2, are your scripts by chance based on the info given in the links I found? I don’t intend to be stubborn, but they’d look logical and besides they’d allow to install recent Java versions…

b) How is it that IcedTea plugin is uncompatible with Oracle’s Java, but Oracle’s plugin may indeed be compatible with openJDK?

c) I think I was mistaking plugins with addons/extensions. They even have their own directories inside /usr/lib64 as mentioned above. But then, why is it that Firefox doesn’t come with a user-local dedicated directory for plugins by default?

d) If I wanted to do system-wide installation, would symlinking plugin to /usr/lib64/browser-plugins work for Firefox?

e) In the other thread it was mentioned that nintendo8’s online games worked with sound in java mode, but without sound in javascript. Could “java mode” be Oracle’s Java and “javascript” openJDK? That would explain it…

Thanks again.

f) How should I best install Java rpm (and other rpms in general), via “zypper” or “rpm” itself?

By the way, seems the SDB about Java worked well for someone

a. The “Discussion” page to the SDB describes exactly what my scripts do, and the scripts themselves can be compared to the original SDB code. The scripts almost all are simply a simple way of executing all the commands at once instead of typing each of the 80 or so commands one at a time.

The main improvement I made which diverges from executing the original command was converting all the MAN pages. For whatever reason, the original code was incomplete. I therefor created a little program that looks at every MAN page that exists and converts them. If anyone were to add or remove a MAN page, my app would automatically adjust compared to the original code which would not.

The other improvement is that the original SDB code describes removing openjdk before installing Oracle Java. My scripts ensure that step isn’t necessary so you can retain openjdk side by side with Oracle Java.

b. Not sure what you mean by using the word “compatible” when comparing plugins that should do similar work. But, this is the fundamental idea… If there is a switching app like update-alternatives which can switch between implementations of similar functionality, then having those implementations installed side by side shouldn’t be a problem. But, if there is no switching app, then two or more implementations will stomp on each other because both will try to provide the same result differently and it’s unpredictable how the system would behave. Sorry if that wasn’t clear…

c. IMO addons/extensions are the same as plugins. Different projects and apps can name the same things differently. And, everyone will have a different idea how to design something. This is not a world where everyone magically agrees to do things exactly the same way.

d. At least for the way described in the Java SDB and IMO <properly> implemented in my scripts symlinking is done so that you can provide different versions of the same file. In the Windows world this is called “DLL Hell” and the same principle exists elsewhere including in Linux. It’s why even in Linux you can have multiple versions of the same Library files but if you aren’t careful with the versions or in some cases changes are made to a file without changing the version, the file will be different and could cause problems if the app expects the earlier unchanged file. The Java SDB described what IMO is an ingenious way to address this… You install the new library files in their own tree and symlink to the expected location modifying the link to use a modified name so that it doesn’t stomp on existing files with the same name. Then, update-alternatives is configured to point to either the original files or to the files with the modified names. This is so cool because this allows files with the same name to exist and be used on a system despite each file being very different.

e. You can follow that other thread’s instructions as well since he reported a success installing only the JRE and using his own method of browser plugin installation. IMO his confusion was that “javascript” is not the same as “java” – The only thing those technologies have in common are 4 letters (j-a-v-a).

HTH,
TSU

I’m finally seeing that your scripts are based on the SDB (guess it got a bit fixed after all…), with some improvements. Seems one of these improvements is including all MAN pages for the case of JDK installation, instead of just some of them as SDB mentions.

a) However I’m also interested in learning exactly what I’m doing, and that’s why I’m right now trying to understand SDB, and comparing to the links I found above. First, I understand update-alternatives serves to be able to switch between Java implementations (Oracle’s and openJDK). But certainly the update-alternatives step in the links is very different from the SDB one (SDB just “installs” one thing and “sets” another, while links “install” more stuff). What’s this about?

b) Since it’s advised everywhere to indeed uninstall IcedTea plugin, I thought this was about incompatibility, that’s it. Based on what you say, if there was an application that switched between Java plugin versions, probably it wouldn’t be necessary to uninstall IcedTea. But it’s not the case. However, why are we removing IcedTea and keeping Oracle’s plugin then?

d) & e) So in the end either symlinking to ~/.mozilla/plugins or /usr/lib64/browser-plugins are both correct ways to install Java plugin on Firefox? Which one would be the most orthodox one?

f) How should I best install Java rpm (and other rpms in general), via “zypper” or “rpm” itself?

On 2014-09-15 06:56, F style wrote:
>
> I’m finally seeing that your scripts are based on the SDB (guess it got
> a bit fixed after all…), with some improvements. Seems one of these
> improvements is including all MAN pages for the case of JDK
> installation, instead of just some of them as SDB mentions.

I have to look at the instructions again, because for JRE I simply
install the oracle rpm and use update-alternatives. For the JDK I simply
do not know, and in fact, installing the JDK rpm together with the JRE
disables the plugin and other things. I think I read TSU saying to only
install the JDK in that case, so I have to read those instructions.

> b) Since it’s advised everywhere to indeed uninstall IcedTea plugin, I
> thought this was about incompatibility, that’s it. Based on what you
> say, if there was an application that switched between Java plugin
> versions, probably it wouldn’t be necessary to uninstall IcedTea. But
> it’s not the case. However, why are we removing IcedTea and keeping
> Oracle’s plugin then?

AFAIK it is not possible for firefox to choose plugin. If the icedtea
plugin is active, even if tha java plugin is also available, I have seen
sites that simply fail; and they happen to be government sites I need to
use for tax form filling. Their instructions explicitly say to remove
icedtea plugin, so that is that. I tabooed it in YaST.

> f) How should I best install Java rpm (and other rpms in general), via
> “zypper” or “rpm” itself?

For single rpms, I use ‘rpm’. Way faster. Only when it complains about
dependencies I consider using zypper.

What I do is save those rpms in a single directory, and add that
directory as repository. Then those appear in YaST, and “zypper up” will
automatically update them.


Cheers / Saludos,

Carlos E. R.
(from 13.1 x86_64 “Bottle” at Telcontar)

Install plugin:

Firefox searches multiple locations. Addon Scope (extensions. enabledScopes):
http://mike.kaply.com/2012/02/21/understanding-add-on-scopes/
http://kb.mozillazine.org/About:config_entries#Extensions.
Scroll down to where they talk about Linux and click on “(read this for other Linux locations)” at:
http://kb.mozillazine.org/Issues_related_to_plugins#Plugin_location

I left OpenJDK installed on the system asis (at this time), and installed Java in /usr/local/jdkx.x.x_xx (where x is the version).
It could be installed in your own $HOME directory too.
In regards to the browser plugin all I did was create a symbolic link in $HOME/.mozilla/plugins/ to libnpjp2.so
(ln -s /usr/local/jdkx.x.x_xx/jre/lib/amd64/libnpjp2.so .).
Restarted FF and disabled/enabled plugins in the browser.
Handy way to check in FireFox is “about:plugins”.
If all you need is the browser plugin that’s it.

But if you want to run applications (outside browser) with a specific version, it can be done via environmental variable changes.

I source a script in my $HOME/.bashrc to change the following:
declare -x JAVA_HOME=“/usr/local/jdkx.x.x_xx”
declare -x JRE_HOME=“${JAVA_HOME}/jre”
declare -x JAVA_BINDIR=“${JAVA_HOME}/bin”
declare -x SDK_HOME=“${JAVA_HOME}”
declare -x JDK_HOME=“${JAVA_HOME}”
declare -x JAVA_ROOT=“${JAVA_HOME}”
declare JAVA_MAN=“${JAVA_HOME}/man”

Add these to PATH and MANPATH in appropriate position.
Create command to display current java environment:

function jvars() {
local – nl=$’
’ # $’
’ variable prevent quotes in parameter expansion output below in bash v4.0 (fixed in later versions)
declare -p ${!J@}
declare -p ${!SD@}
alias netbeans
printf – ’
%s
’ “${PATH//:/${nl}}”
printf – ’
%s
’ “${MANPATH//:/${nl}}”
}

I use Yast which has a gui for RPM (Online Update/Software Management).

I search for software via Yast in the installation provided OSS and NONOSS repositories.
I do add Pacman. Otherwise I go to http://software.opensuse.org.
If I find supported software here, openSUSE branded FF has an addon for one-click install (which uses Yast).
Be careful of external rpms.

Otherwise I use rpm to query things quickly from the command line, like:

rpm -qa |grep -i mozilla
rpm -qi MozillaFirefox
rpm -qa --last |less
rpm -qivp rpm_name.rpm

You can get really fancy:
rpm -qa --qf '%{installtime} %{name}-%{version} %{installtime:date}

Check out: --whtprovides, --requires, --provides, -ql, -qf

If you use “rpm” to install/uninstall check out the option “–test” and ‘-vv’ (man rpm).

I did not install java via rpm. I downloaded the tar.gz and ran their script.
There is a difference if you run as root vs user.
The thing with external rpm’s (non-openSUSE), you do not readily know their file structure.
It is my personal preference to have more control in these cases.

There is a standard that is mostly followed: Filesystem Hierarchy Standard

Thanks all.
Sorry for still being stubborn, but I still can’t get through inquiries a) and d)