Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The plugin doesn't work if Jenkins is running with Java 1.7 #28

Closed
ghost opened this issue Apr 27, 2016 · 7 comments
Closed

The plugin doesn't work if Jenkins is running with Java 1.7 #28

ghost opened this issue Apr 27, 2016 · 7 comments
Labels

Comments

@ghost
Copy link

ghost commented Apr 27, 2016

I have try to run your plugin in my Jenkins instance that use a Java version:

$java -version
java version "1.7.0_80"
Java(TM) SE Runtime Environment (build 1.7.0_80-b15)
Java HotSpot(TM) 64-Bit Server VM (build 24.80-b11, mixed mode)

but I get the following error:

WARNING: Failed to load com.github.kostyasha.yad.DockerProvisioningStrategy
java.lang.InstantiationException: java.lang.UnsupportedClassVersionError: com/github/kostyasha/yad/DockerProvisioningStrategy : Unsupported major.minor version 52.0
    at net.java.sezpoz.IndexItem.element(IndexItem.java:146)
    at hudson.ExtensionFinder$Sezpoz._find(ExtensionFinder.java:626)
    at hudson.ExtensionFinder$Sezpoz.find(ExtensionFinder.java:615)
    at hudson.ClassicPluginStrategy.findComponents(ClassicPluginStrategy.java:389)
    at hudson.ExtensionList.load(ExtensionList.java:349)
    at hudson.ExtensionList.ensureLoaded(ExtensionList.java:287)
    at hudson.ExtensionList.iterator(ExtensionList.java:156)
    at hudson.ClassicPluginStrategy.findComponents(ClassicPluginStrategy.java:382)
    at hudson.ExtensionList.load(ExtensionList.java:349)
    at hudson.ExtensionList.ensureLoaded(ExtensionList.java:287)
    at hudson.ExtensionList.getComponents(ExtensionList.java:167)
    at hudson.DescriptorExtensionList.load(DescriptorExtensionList.java:185)
    at hudson.ExtensionList.ensureLoaded(ExtensionList.java:287)
    at hudson.ExtensionList.iterator(ExtensionList.java:156)
    at jenkins.branch.CustomOrganizationFolderDescriptor.doAddSpecificDescriptors(CustomOrganizationFolderDescriptor.java:140)
    at jenkins.branch.CustomOrganizationFolderDescriptor.addSpecificDescriptors(CustomOrganizationFolderDescriptor.java:123)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at hudson.init.TaskMethodFinder.invoke(TaskMethodFinder.java:106)
    at hudson.init.TaskMethodFinder$TaskImpl.run(TaskMethodFinder.java:176)
    at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:282)
    at jenkins.model.Jenkins$8.runTask(Jenkins.java:925)
    at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:210)
    at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:117)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.UnsupportedClassVersionError: com/github/kostyasha/yad/DockerProvisioningStrategy : Unsupported major.minor version 52.0
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
    at jenkins.util.AntClassLoader.defineClassFromData(AntClassLoader.java:1139)
    at hudson.ClassicPluginStrategy$AntClassLoader2.defineClassFromData(ClassicPluginStrategy.java:802)
    at jenkins.util.AntClassLoader.getClassFromStream(AntClassLoader.java:1310)
    at jenkins.util.AntClassLoader.findClassInComponents(AntClassLoader.java:1366)
    at jenkins.util.AntClassLoader.findClass(AntClassLoader.java:1326)
    at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at jenkins.ClassLoaderReflectionToolkit.invoke(ClassLoaderReflectionToolkit.java:44)
    at jenkins.ClassLoaderReflectionToolkit._findClass(ClassLoaderReflectionToolkit.java:86)
    at hudson.PluginManager$UberClassLoader.findClass(PluginManager.java:1209)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
    at net.java.sezpoz.IndexItem.element(IndexItem.java:134)
    ... 28 more
@ghost ghost changed the title The plugin doesn't work if Jenkins is running with java 1.7 The plugin doesn't work if Jenkins is running with Java 1.7 Apr 27, 2016
@KostyaSha
Copy link
Owner

It uses streams and requires java8.

@ghost
Copy link
Author

ghost commented Apr 27, 2016

I can understand your point but I'm pretty sure that there are lot of projects out there that use an older Java version. In my opinion backward compatibility at least with Java 1.7 should be ensured. Anyway, thanks for your quick response!

@KostyaSha
Copy link
Owner

1.7 http://www.oracle.com/technetwork/java/javase/downloads/eol-135779.html and code uses streams/lambda. Rewriting code because of EOL java version makes no sense.

@fastman
Copy link

fastman commented May 10, 2016

Hi,
Can you at least state that in the documentation/readme? I've spent some time figuring it :-)

@KostyaSha
Copy link
Owner

KostyaSha commented May 10, 2016

That's a good question to core because information is available in pom and jenkins should do warnings.
@fastman for future i can suggest looking at pom.xml https://github.com/KostyaSha/yet-another-docker-plugin/blob/master/pom.xml#L54 java version is enforced in maven-compiler-plugin.
Will try find time and place somewhere information.

@fastman
Copy link

fastman commented May 11, 2016

@KostyaSha just imagine the world, where users of jenkins are not Java programmers

@KostyaSha
Copy link
Owner

@fastman frankly speaking i even had no good documentation :) i can push wiki into separate GH repo and accept updates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants