ctongfei / progressbar

Terminal-based progress bar for Java / JVM
http://tongfei.me/progressbar/
MIT License
1.07k stars 102 forks source link

Progressbar error:Exception in thread "main" java.lang.NoSuchMethodError: org.jline.terminal.TerminalBuilder.dumb(Z)Lorg/jline/terminal/TerminalBuilder; #160

Open niuzhi opened 6 months ago

niuzhi commented 6 months ago

Hello, I am using progressbar to build an application. At the same time, I have also introduced the kotlin-compiler package into my project. When using ProgressBar to build the terminal, I always call the jline library under the kotlin-compiler package instead of the dependency of Processbar. The jline library causes the following exception. How should I solve it?

image

my environment: pom.xml

me.tongfei progressbar 0.9.5 org.apache.logging.log4j log4j-api 2.17.1 org.apache.logging.log4j log4j-core 2.17.1 org.jline jline 3.21.0 org.jetbrains.kotlin kotlin-compiler 1.7.22

code: public class Main { public static void main(String[] args) {

    List<String> data = new ArrayList<>();
    data.add("a");
    data.add("b");
    ProgressBarBuilder pbb = (new ProgressBarBuilder()).setInitialMax(2).setTaskName("Test").setStyle(ProgressBarStyle.ASCII);

    Iterator iterator = ProgressBar.wrap(data, pbb).iterator();

}

}

ctongfei commented 6 months ago

What jline version does your Kotlin-compiler depend on? It seems to me that this is a Java JAR linking error: there may be 2 versions of jline in conflict, so that org.jline.terminal.TerminalBuilder.dumb is not found?