question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Dependencies are working only with jdk8

See original GitHub issue

Using >8 JDK everything is working except dependency resolution:

[kscript] Resolving dependencies...
[kscript]     Resolving "org.openjsse:openjsse:1.1.0"...Exception in thread "main" java.lang.NoClassDefFoundError: org/ietf/jgss/GSSException
	at com.ning.http.client.providers.netty.NettyAsyncHttpProvider.<clinit>(NettyAsyncHttpProvider.java:177)
	at org.sonatype.aether.connector.async.AsyncRepositoryConnector.getDefaultProvider(AsyncRepositoryConnector.java:246)
	at org.sonatype.aether.connector.async.AsyncRepositoryConnector.getProvider(AsyncRepositoryConnector.java:241)
	at org.sonatype.aether.connector.async.AsyncRepositoryConnector.<init>(AsyncRepositoryConnector.java:154)
	at org.sonatype.aether.connector.async.AsyncRepositoryConnectorFactory.newInstance(AsyncRepositoryConnectorFactory.java:106)
	at org.sonatype.aether.impl.internal.DefaultRemoteRepositoryManager.getRepositoryConnector(DefaultRemoteRepositoryManager.java:346)
	at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:453)
	at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:216)
	at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolveArtifact(DefaultArtifactResolver.java:193)
	at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:281)
	at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.readArtifactDescriptor(DefaultArtifactDescriptorReader.java:186)
	at org.sonatype.aether.impl.internal.DefaultDependencyCollector.collectDependencies(DefaultDependencyCollector.java:191)
	at org.sonatype.aether.impl.internal.DefaultRepositorySystem.resolveDependencies(DefaultRepositorySystem.java:333)
	at com.jcabi.aether.Aether.fetch(Aether.java:228)
	at com.jcabi.aether.Aether.resolve_aroundBody2(Aether.java:180)
	at com.jcabi.aether.Aether$AjcClosure3.run(Aether.java:1)
	at org.aspectj.runtime.reflect.JoinPointImpl.proceed(JoinPointImpl.java:149)
	at com.jcabi.aspects.aj.MethodLogger.wrap(MethodLogger.java:208)
	at com.jcabi.aspects.aj.MethodLogger.ajc$inlineAccessMethod$com_jcabi_aspects_aj_MethodLogger$com_jcabi_aspects_aj_MethodLogger$wrap(MethodLogger.java:1)
	at com.jcabi.aspects.aj.MethodLogger.wrapClass(MethodLogger.java:136)
	at com.jcabi.aether.Aether.resolve(Aether.java:177)
	at com.jcabi.aether.Aether.resolve_aroundBody0(Aether.java:163)
	at com.jcabi.aether.Aether$AjcClosure1.run(Aether.java:1)
	at org.aspectj.runtime.reflect.JoinPointImpl.proceed(JoinPointImpl.java:149)
	at com.jcabi.aspects.aj.MethodLogger.wrap(MethodLogger.java:208)
	at com.jcabi.aspects.aj.MethodLogger.ajc$inlineAccessMethod$com_jcabi_aspects_aj_MethodLogger$com_jcabi_aspects_aj_MethodLogger$wrap(MethodLogger.java:1)
	at com.jcabi.aspects.aj.MethodLogger.wrapClass(MethodLogger.java:136)
	at com.jcabi.aether.Aether.resolve(Aether.java:156)
	at kscript.app.DependencyUtilKt.resolveDependenciesViaAether(DependencyUtil.kt:86)
	at kscript.app.DependencyUtilKt.resolveDependencies(DependencyUtil.kt:53)
	at kscript.app.KscriptKt.main(Kscript.kt:158)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:567)
	at org.jetbrains.kotlin.runner.AbstractRunner.run(runners.kt:61)
	at org.jetbrains.kotlin.runner.Main.run(Main.kt:110)
	at org.jetbrains.kotlin.runner.Main.main(Main.kt:120)
Caused by: java.lang.ClassNotFoundException: org.ietf.jgss.GSSException
	at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:436)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:588)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
	... 38 more

A first bug was reported #233

jdk8 is 5 years old and some people prefer to use newer versions of jdk.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:18
  • Comments:49 (5 by maintainers)

github_iconTop GitHub Comments

14reactions
ligeecommented, May 14, 2020

I haven’t looked into this issue deep enough, so don’t know whether it could be relevant or not, but just for the information: Kotlin 1.4 will include a new API for the dependencies resolution in scripting and a new lib for resolving Maven artifacts, and the latter is not based on the (seemingly orphaned) jcabi-aether, but rather on the org.eclipse.aether and apache maven libs directly. https://github.com/JetBrains/kotlin/tree/master/libraries/scripting/dependencies-maven

8reactions
holgerbrandlcommented, Nov 10, 2020

Finally fixed in v3.0 😃

Thank you all for your support and patience. Special thanks to @ligee for your continued great help and guidance.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Dependencies are working only with jdk8 · Issue #239 - GitHub
I just checked and resolving dependencies work on *.main.kts files with Java 11 using kotlin 1.3.70 directly.
Read more >
Can a java 8 project depend on a java 11 dependency in gradle
The short answers is YES, you can use a Java 11 dependency in a Java 8 project. The following error class file has...
Read more >
Compatibility Guide for JDK 8 - Oracle
This document discusses types of potential incompatibilities relating to the JDK 8 release of the Java platform.
Read more >
Transition from Java 8 to Java 11 - Azure - Microsoft Learn
A guide for managing the move from Java 8 to Java 11.
Read more >
Learning the Basics - Gradle User Manual
If you only work with flat directory repositories you don't need to set all ... Now, we can request a Java 8 versions...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found