Skip to content

Instantly share code, notes, and snippets.

@minhoryang
Created October 16, 2015 07:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save minhoryang/588700d6d6ce3fb44183 to your computer and use it in GitHub Desktop.
Save minhoryang/588700d6d6ce3fb44183 to your computer and use it in GitHub Desktop.
package minhoryang.github.io.jline2_test;
import java.io.IOException;
import jline.TerminalFactory;
import jline.console.ConsoleReader;
/**
* Hello world!
* XXX: starts with Eclipse Default Maven Template.
* XXX: using run_for_jar_export.xml, You can get runnable exported.jar and run by `java -jar exported.jar`.
*/
public class App
{
public static void main( String[] args )
{
TerminalFactory.configure(TerminalFactory.Type.WINDOWS);
try {
ConsoleReader a = new ConsoleReader();
String input = a.readLine();
a.clearScreen();
a.println("Inputted : " + input);
a.flush();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
System.out.println( "Hello World!" );
}
}
<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>minhoryang.github.io</groupId>
<artifactId>jline2-test</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>jline2-test</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>jline</groupId>
<artifactId>jline</artifactId>
<version>2.12</version>
</dependency>
</dependencies>
</project>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project default="create_run_jar" name="Create Runnable Jar for Project jline2-test">
<!--this file was created by Eclipse Runnable JAR Export Wizard-->
<!--ANT 1.7 is required -->
<!--define folder properties-->
<property name="dir.buildfile" value="."/>
<property name="dir.workspace" value="${dir.buildfile}/.."/>
<property name="dir.jarfile" value="${dir.buildfile}"/>
<target name="create_run_jar">
<jar destfile="${dir.jarfile}/exported.jar" filesetmanifest="mergewithoutmain">
<manifest>
<attribute name="Main-Class" value="minhoryang.github.io.jline2_test.App"/>
<attribute name="Class-Path" value="."/>
</manifest>
<fileset dir="${dir.jarfile}/target/classes"/>
<zipfileset excludes="META-INF/*.SF" src="C:/Users/R912/.m2/repository/jline/jline/2.12/jline-2.12.jar"/>
<!-- TODO(*): replace here -->
</jar>
</target>
</project>
@minhoryang
Copy link
Author

Y U NO directory support, gist?!

@soon91jae
Copy link

아 terminal factory에 넣는 값을 string "windows"로 하여서 그런거였슴다. 정말감사합니다.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment