Results 1 to 3 of 3

Thread: java problem

  1. #1

    Default java problem


    Java and javac have diffrerent verison.

    [#java -version
    java version "1.7.0_51"
    OpenJDK Runtime Environment (IcedTea 2.4.4) (suse-24.13.5-x86_64)
    OpenJDK 64-Bit Server VM (build 24.45-b08, mixed mode)
    javac -version
    javac 1.8.0_05
    I have a trouble with java.Here for example I have ""(simple Hello World example) and

    is done but now

     # java JavaApplication1
    Exception in thread "main" java.lang.UnsupportedClassVersionError: JavaApplication1 : Unsupported major.minor version 52.0
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(
        at Method)
        at java.lang.ClassLoader.loadClass(
        at sun.misc.Launcher$AppClassLoader.loadClass(
        at java.lang.ClassLoader.loadClass(
        at sun.launcher.LauncherHelper.checkAndLoadMain(
    Why I see this error.

    # cat /etc/SuSE-release
    openSUSE 13.1 (x86_64)
    VERSION = 13.1
    CODENAME = Bottle
    #uname -m

  2. #2
    Join Date
    Feb 2009

    Default Re: java problem

    On 2014-06-02 23:46, seniorc wrote:
    > Hello,
    > Java and javac have diffrerent verison.

    Try "which java" and "which javac", and follow the chain to find out
    which one it actually is.

    Cheers / Saludos,

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

  3. #3
    Join Date
    Jun 2008
    San Diego, Ca, USA
    Blog Entries

    Default Re: java problem

    Depending on what you're doing, it should not make any difference.

    Your post says that you are running openJDK for your JRE
    likely Oracle Java for your java compiler (javac). I say likely because although you don't describe where your java compiler came from, it's kind of unusual to use any but the Oracle compiler and I don't know if any other than Oracle Java has released a version 8 yet.

    The way I see your situation you have 2 options because at the moment there is no recommended procedure to install Java 8 in openSUSE while also using update-alternatives.

    If Oracle 8 is important to you, then
    - Uninstall openJDK from your system
    - Download Oracle SE 1.8 following the instructions to install (I recommend using the RPM), first the JRE and then the javac. Optional is to also install the web plugin.

    If Oracle 8 is not that important to you, installing Oracle SE is very easy, I created some scripts which will have you fully installed in under 30 seconds after you download the Oracle RPM and my scripts.
    - Since the install will create an update-alternatives configuration, you don't need to uninstall any previous Java which may exist
    - Inspect the official openSUSE Java documentation, but <don't actually follow it>. Instead. click on the "Discussion" tab and click on the link to github where I've posted installation scripts I created. This is the link if you just want to click on it here
    - Follow the instructions, you only need to run each of the scripts in order to install, takes less than 30 seconds and you will have both a working JRE and javac.
    In any case, AFAIK Oracle 8 is so new whatever you build may or may not run on someone else' system unless they update their Java to latest. If you build anything with Java 7, it'll probably run with the version Java they already have installed.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts