Error when upDate Java 8 on OpenSuse 13,1

I use OpenSuse 13.1, KDE and Firefox – 64 Bits

I’m trying to update Java, but when I install version 8, there is an error that says missing a package.
The message is:

“No one provides / usr / sbin / alternatives, it is necessary to jdk1.8.0_40-2000: 1.8.0_40-fcs.x86_64”

Can anyone advise how to solve this?

Thanks in advance

Ok.
I gave up trying to use java 8
So I used OpenSuse repository that is running java 7
But now, also does not run,

See what happens when I try to use the file PgdCarneLeao.jar

sergio@linux-kplg:~/Documentos/LEAO2015> java PgdCarneLeao.jar
Error: Could not find or load the main class PgdCarneLeao.jar
Redirecting Error Message for ‘LEAO2015.log’ …

This is the contents of the file ‘LEAO2015.log’ …


sergio@linux-kplg:~/Documentos/LEAO2015> cat /home/sergio/ProgramasRFB/LEAO2015/LEAO2015.log
Sistema: Linux
Java: 1.7.0_55
java.awt.HeadlessException
        at java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:207)
        at java.awt.Window.<init>(Window.java:535)
        at java.awt.Frame.<init>(Frame.java:420)
        at java.awt.Frame.<init>(Frame.java:385)
        at javax.swing.SwingUtilities$SharedOwnerFrame.<init>(SwingUtilities.java:1756)
        at javax.swing.SwingUtilities.getSharedOwnerFrame(SwingUtilities.java:1831)
        at javax.swing.JWindow.<init>(JWindow.java:185)
        at gov.serpro.carneleao.gui.at.<init>(Unknown Source)
        at gov.serpro.app.a.<init>(Unknown Source)
        at gov.serpro.app.PGDCarneLeao.<init>(Unknown Source)
        at gov.serpro.app.PGDCarneLeao.main(Unknown Source)
Exception in thread "main" java.awt.HeadlessException
        at java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:207)
        at java.awt.Window.<init>(Window.java:535)
        at java.awt.Frame.<init>(Frame.java:420)
        at java.awt.Frame.<init>(Frame.java:385)
        at javax.swing.SwingUtilities$SharedOwnerFrame.<init>(SwingUtilities.java:1756)
        at javax.swing.SwingUtilities.getSharedOwnerFrame(SwingUtilities.java:1831)
        at javax.swing.JOptionPane.getRootFrame(JOptionPane.java:1697)
        at javax.swing.JOptionPane.showOptionDialog(JOptionPane.java:863)
        at javax.swing.JOptionPane.showMessageDialog(JOptionPane.java:667)
        at javax.swing.JOptionPane.showMessageDialog(JOptionPane.java:638)
        at classes.aj.a(Unknown Source)
        at gov.serpro.app.PGDCarneLeao.main(Unknown Source)

What should I do to run .jar files?
Please, any idea is welcome

java -jar filename.jar
Remember that OpenJDK 1.8.0 is Java 8;
zypper in java-1_8_0-openjdk java-1_8_0-openjdk-devel

->

update-alternatives --config java

And choose 1.8.0. Then retry your application.

Now I’m using java installed from repositories (version 1.7.0_55)

If I do
“zypper in java-1_8_0-openjdk java-1_8_0-openjdk-devel”
there will be conflicts?

Woops, noticed you were on 13.1 - openJDK 1.8.0 is not available by default for it.

It’s available in the Java:Factory if you want to try it out - it should co-exist with 1.7.0 happily. No guarantees though, I’ve only used it on 13.2.

I tried that.
See the first post.

We’re not talking about the same repo.

http://download.opensuse.org/repositories/Java:/Factory/openSUSE_13.1/

And I’d like to emphasize that I haven’t used this on 13.1 so I cannot guarantee stability or anything else for that matter. At your own risk.

Excuse Me. I do not know how Java installations are made.

I understand that you say that the version 8 I downloaded directly from Oracle’s site is different from the path
http://download.opensuse.org/repositories/Java:/Factory/openSUSE_13.1/

Or is it not so ?

This needed to be clarified first…
Where your Java is coming from.
The procedures for installing Java from Oracle are different than when installing Java from any of the openSUSE repositories.

I recognized the error you first described, it’s what you see when you install the Java JDK RPM downloaded from Oracle. The RPM installs the JDK files in its own folder tree but does not symlink the files so that the system knows where they are and does not install/configure appropriate update-alternatives. BTW - IMO this is better than some cookbooks which install the JDK directly into the usual library tree which would stomp over other versions of Java… By installing in its own separate tree and symlinking, this permits side by side installation of different JDK.

Although the procedure for installing Oracle SE JDK 7 is described in the SDB-Install Java
https://en.opensuse.org/SDB:Installing_Java
If you’d like to install quickly and easily in less than a minute, I created and maintain a small package of scripts that do all the work and apply some improvements
https://github.com/putztzu/openSUSE_Oracle_Java_Install

As of today, AFAIK there is an unresolved bug following the SDB to install Oracle SE JDK 8, so do not recommend that. Install the 8 version of openjdk-devel for now from the openSUSE repos.

IMO,
TSU

Thanks TSU

I understand that your script will only install the java 7, Ok.?

But the script installs the 64 or 32 bits?

Another thing, I’m using OpenSuse 13.1 This version does not have java 8 in the repositories.

Yes, at this time the scripts support only Oracle SE JDK 7, both i586 (which is 32-bit) and x64 (which is 64-bit) (You’ll find both sets of scripts in your clone or download).

Until some issues are resolved specific to JDK 8, I haven’t released working scripts for that.
But, JDK 7up75(current latest Oracle release) will absolutely work.

TSU

I am very confused.
After performing “zypper in git,” The instructions are:

“Then run the scripts in Their numbered order.”

The first line is To create a link -> No problem
But the second is like should I copy, and run an executable, is it?

  1. Install the SE 7 JDK RPM, downloaded from oracle using the link I provided.

  2. You can download the scripts I provided a number of different ways.
    You can click on the ZIP link in the ri pane.
    Or,
    The instructions I provide describe how to use “git clone” which creates a local copy of everything I provided. It also means that in the future if you want to download an updated copy of my scripts, you only need to run “git pull”

  3. Assuming that you are running on a 64-bit version of openSUSE (any version)

  • Open a root console
  • cd x64
    if you run ls, you should then see the scripts for a 64-bit system, they should also all be already executable.
  • Execute each script in order, for example
./1.* tab to complete *
./2.* tab to complete* 

and so on.

The name of of each script describes what the script does. When you have completed your last script, you’re done!
Well, actually as my README describes, you still need to run update-alternatives to set your system to your newly installed JDK

update-alternatives --config java

TSU