JLine

在 IDEA 开发环境里使用 jline 无法正常工作的问题处理

孤者浪人 提交于 2020-12-01 19:32:14
现象:在 IDEA 中开发应用,使用 jline 捕获控制台输入时,无法正常运行,主要体现在如下代码在输入回车后无法执行: ConsoleReader reader = new ConsoleReader(); reader.readLine("> "); 解决的办法: 在使用 jline 之前,执行如下代码即可: jline.TerminalFactory.registerFlavor(TerminalFactory.Flavor.WINDOWS, jline.UnsupportedTerminal.class); 也可以在程序启动的命令行里增加参数 -Djline.terminal=jline.UnsupportedTerminal 搞定。 来源: oschina 链接: https://my.oschina.net/javayou/blog/4768085

maven处理多版本jar包依赖冲突

拟墨画扇 提交于 2020-11-09 20:09:21
mvn dependency:tree的用法 一.参考文档 https://maven.apache.org/plugins/maven-dependency-plugin/examples/resolving-conflicts-using-the-dependency-tree.html https://maven.apache.org/plugins/maven-dependency-plugin/examples/filtering-the-dependency-tree.html https://maven.apache.org/plugins/maven-dependency-plugin/tree-mojo.html 二.查看jar包的间接依赖 1.如果发现某个jar包,自己的pom中并没有定义,想看一下是被哪个jar包间接引用的,两种方法 (1)用mvn dependency:tree>temp/tree.txt,直接输出到当前项目下,然后在idea中打开,搜索要找的jar包名字即可. 这里的 "+-" 和"\-"并没有什么意义,只是为了让分级看起来更直观 参考:https://stackoverflow.com/questions/34006740/what-is-the-difference-between-and-in-maven-dependency

mac zookeeper安装使用

◇◆丶佛笑我妖孽 提交于 2020-04-09 04:26:14
zookeeper是构建分布式系统的重要组件,今天尝试了使用homebrew在mac上安装zookeeper,本文是安装过程的完整记录. 安装zookeeper 查看可用版本 使用命令 $ brew info zookeeper 查看可用版本信息: zookeeper: stable 3.4.8, HEAD Centralized server for distributed coordination of services https://zookeeper.apache.org/ Not installed From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/zookeeper.rb ==> Options --with-perl Build Perl bindings --with-python Build with python support --HEAD Install HEAD version ==> Caveats To have launchd start zookeeper now and restart at login: brew services start zookeeper Or, if you don't want/need a background service

Hive搭建——多用户模式remote一体和分开

一个人想着一个人 提交于 2020-01-10 15:18:05
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 1.Remote一体 这种存储方式需要在远端服务器运行一个mysql服务器,并且需要在Hive服务器启动meta服务。 <?xml version="1.0"?> <?xml-stylesheet type="text/xsl" href="configuration.xsl"?> <configuration> <property> <name>hive.metastore.warehouse.dir</name> <value>/user/hive/warehouse</value> </property> <property> <name>javax.jdo.option.ConnectionURL</name> <value>jdbc:mysql://192.168.57.6:3306/hive?createDatabaseIfNotExist=true</value> </property> <property> <name>javax.jdo.option.ConnectionDriverName</name> <value>com.mysql.jdbc.Driver</value> </property> <property> <name>javax.jdo.option

How to write an equivalent of KeyListener with JLine?

一笑奈何 提交于 2019-12-22 13:49:40
问题 I am working on a console application written in Java. What I have to do is handle user keyboard input. When a long process in launched with our program in a terminal, the user must have the possibility to press 'q' at anytime to stop the process (which is running on a separate thread). I've tried several things : Running in another different thread something that read user input and throws an InterruptedException to the process' thread Using JLine and its ConsoleReader Using JLine and add a

jline keep prompt at the bottom

百般思念 提交于 2019-12-21 02:58:04
问题 I am using jline and I have a neat ConsoleReader and everything works great. However, if you are typing something into the the prompt and there is output on stdout (from another thread), the output splits the word/command that you are typing. How can I keep the jline prompt at the bottom of the terminal? I am using jline 1, but I am open to using jline 2 if it is stable enough. 回答1: Finally figured this out... here's what you do. First, define these functions: private ConsoleReader console =

Fuse dead after restart

一个人想着一个人 提交于 2019-12-11 18:28:14
问题 I rebuilt my docker with Fuse (Red Hat Fuse (7.0.0.fuse-000191-redhat-1) ) on Centos 7, and everything is broken now. I didn't change anything. Could a yum update cause this? Exception caught while executing command org.osgi.service.resolver.ResolutionException: Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=jline; type=karaf.feature; version="[3.6.2,3.6.2]"; filter:="(&(osgi.identity=jline) (type=karaf.feature)(version>=3.6.2)(version<=3.6.2))" [caused by:

Why is my javap output different than yours for the same jar file?

≯℡__Kan透↙ 提交于 2019-12-11 16:42:16
问题 I'm having trouble compiling code which has a maven dependency on jline-0.9.94. Specifically, I'm compiling Groovy 1.7.6 using its default Ant target and getting the following error: [...] -banner: [echo] Java Runtime Environment version: 1.6.0_22 [echo] Java Runtime Environment vendor: Apple Inc. [echo] Ant version: Apache Ant version 1.7.1 compiled on June 27 2008 [echo] Operating system name: Mac OS X [echo] Operating system architecture: x86_64 [echo] Operating system version: 10.6.6

How to save and load history between invocations of Scala JLine

冷暖自知 提交于 2019-12-10 09:37:47
问题 I'm using Scala JLine in my CLI program. It's working fine, but it forgets my history every time I restart my program. I see a class called FileHistory , and I see the ConsoleReader class has a method called setHistory() which takes an instance of FileHistory . I would expect calling that method would cause it to create or load and save a file containing my history. But it doesn't. Unfortunately the documentation is nigh nonexistent. How can I make it so the next time I run my JLine-enabled

jline keep prompt at the bottom

随声附和 提交于 2019-12-03 08:59:41
I am using jline and I have a neat ConsoleReader and everything works great. However, if you are typing something into the the prompt and there is output on stdout (from another thread), the output splits the word/command that you are typing. How can I keep the jline prompt at the bottom of the terminal? I am using jline 1, but I am open to using jline 2 if it is stable enough. Finally figured this out... here's what you do. First, define these functions: private ConsoleReader console = ...; private CursorBuffer stashed; private void stashLine() { this.stashed = this.console.getCursorBuffer()