0

I am just wondering if the OSFactory.builderV3() method can run on JDK 1.6.

It returns the following error:

Exception in thread "main" java.lang.UnsupportedClassVersionError: org/openstack4j/openstack/OSFactory : Unsupported major.minor version 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at Test.main(Test.java:9)

I do know there is a Jersy2JDK1.6 connector works on Keystone V2, like:

org.pacesys
openstack4j-core
3.0.0


org.pacesys.openstack4j.connectors
openstack4j-jersey2-jdk1.6
3.0.0

but in terms of my project, it requires V3 Authentication.

Ruogu Lin
  • 1
  • 2
  • The answer on your current question is `YES`. But I believe, you wanted get another answer. So please modify your question as good as you want to get answer. – Sergii Jul 25 '17 at 06:02

1 Answers1

0

The problem is actually a Java problem. You are trying to run code that was built for JDK 1.8 or later on a JDK 1.6 platform. That won't work. The JDK 1.6 JVM does not understand that version of the bytecode.

In theory, you could try downloading the sourcecode for the library and its dependencies, and building them with a JDK 1.6 compiler / tool-chain. HOWEVER, that will only work if the library and its dependencies are fully Java 6 compatible; i.e. both in terms of source code syntax AND use of the standard Java SE APIs.

In this case, I think it is highly unlikely that that will work. According to the README.md file in the OpenStack4j Github repo:

Requirements

  • OpenStack4j 3.0.X - Java 7 (JDK 8 preferred)
  • OpenStack4j 2.0.X - Java 7

The best solution is to upgrade to Java 8. Java 6 was EOL'ed in April 2013.

There is a saying:

"The most important thing to do if you are in a hole is to stop digging."

A dev't project that is stuck on Java 6 is in a hole.

Stephen C
  • 698,415
  • 94
  • 811
  • 1,216