В проекте, собираемом gradle, используется jdk.internal.org.objectweb.asm
.
build.gradle:
group 'GroupName'
version '1.0-SNAPSHOT'
apply plugin: 'java'
sourceCompatibility = 1.8
repositories {
mavenCentral()
}
dependencies {
testCompile group: 'junit', name: 'junit', version: '4.12'
compileOnly 'org.projectlombok:lombok:1.16.18'
}
Метод main в IDEA запускается нормально, но не собирается через gradle: Execution failed for task ':compileJava'
.
Выводит ошибки на все импорты и классы из jdk.internal.org.objectweb.asm
:
error: package jdk.internal.org.objectweb.asm.tree does not exist
import jdk.internal.org.objectweb.asm.tree.AbstractInsnNode;
error: cannot find symbol
public void add(final LabelNode first, final LabelNode second) {
Почему такое происходит? И как исправить? Решит ли проблему переход на ow2.asm?
Update. Минимальный пример:
package com.example;
import jdk.internal.org.objectweb.asm.tree.AbstractInsnNode;
import jdk.internal.org.objectweb.asm.tree.InsnNode;
import static jdk.internal.org.objectweb.asm.Opcodes.ICONST_0;
public final class Main {
public static void main(final String[] args) {
final AbstractInsnNode node = new InsnNode(ICONST_0);
}
}
Лог:
error: package jdk.internal.org.objectweb.asm.tree does not exist
import jdk.internal.org.objectweb.asm.tree.AbstractInsnNode;
^
error: package jdk.internal.org.objectweb.asm.tree does not exist
import jdk.internal.org.objectweb.asm.tree.InsnNode;
^
error: package jdk.internal.org.objectweb.asm does not exist
import static jdk.internal.org.objectweb.asm.Opcodes.ICONST_0;
^
error: static import only from classes and interfaces
import static jdk.internal.org.objectweb.asm.Opcodes.ICONST_0;
^
4 errors
:compileJava FAILED