我刚在我的IDE中创建了一个Jline3项目,以尝试它是否可用。
这个项目只有一个类,我从这里复制过来的:https://github.com/jline/jline3/blob/master/builtins/src/test/java/org/jline/example/Example.java。
Jline3提供了一些很好的功能,我想要使用它们,虽然文档相当贫乏。问题在于:它不适用于Windows系统。在Mac终端、Centos和甚至Windows上的Git Bash(Mingw)中,它都可以无缝工作。
然而,如果我在Windows终端或Cmder中执行我的jar文件,它会抛出警告并且没有完成器将起作用。
WARNING: unable to create a system terminal, creating dumb terminal (enable debug logging for more information)
我的pom文件长这样:
<?xml version="1.0" encoding="UTF-8"?><project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>jline3Test</groupId>
<artifactId>jline3-test</artifactId>
<version>1.0-SNAPSHOT</version>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>8</source>
<target>8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<configuration>
<createDependencyReducedPom>true</createDependencyReducedPom>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<excludes>META_INF/*.SF</excludes>
<excludes>META_INF/*.DSA</excludes>
<excludes>META_INF/*.RSA</excludes>
</excludes>
</filter>
</filters>
<transformers>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>Application</mainClass>
</transformer>
</transformers>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.jline</groupId>
<artifactId>jline</artifactId>
<version>3.8.0</version>
</dependency>
</dependencies>
问题:
有人知道如何启用调试日志并将日志重定向到system.out吗?
有人遇到过同样的问题并知道如何解决吗?
提前致谢。