首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Windows终端的Jline3问题

Windows终端的Jline3问题
EN

Stack Overflow用户
提问于 2018-10-17 09:12:11
回答 1查看 2K关注 0票数 3

因此,我只是在我的IDE中设置了一个Jline3项目来测试它是否有效。

它只有一个类,我是从这里复制的:https://github.com/jline/jline3/blob/master/builtins/src/test/java/org/jline/example/Example.java

Jline3提供了一些我实际上想要使用的很好的特性,尽管文档非常糟糕。存在的问题;它不能在窗口上工作。它在mac终端上运行得完美无缺,即使是在windows上的git bash中也是如此。

但是,如果我在windows终端或cmder中执行jar,它会抛出一个警告,而所有的完成器都不能工作。

代码语言:javascript
复制
WARNING: unable to create a system terminal, creating dumb terminal (enable debug logging for more information)

我的pom是这样的:

代码语言:javascript
复制
<?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吗?
  • 有没有人有同样的问题,并知道如何解决它?

提前感谢

EN

回答 1

Stack Overflow用户

发布于 2018-10-17 14:49:03

您需要在类路径上有jna (https://mvnrepository.com/artifact/net.java.dev.jna/jna)或jansi (https://mvnrepository.com/artifact/org.fusesource.jansi/jansi)。

有了这一点,您需要jline终端-jansi (https://mvnrepository.com/artifact/org.jline/jline-terminal-jansi)或jline-终端-jna (https://mvnrepository.com/artifact/org.jline/jline-terminal-jna),后者将这些与JLine3集成在一起。

因此,您可以选择使用jansi还是jna,但是必须有两个库。希望这能有所帮助。

也可以直接在Jline3文档中找到:https://github.com/jline/jline3#jansi-vs-jna

最好,马克

票数 5
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/52851232

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档