• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

Question about installing Jansi to use with Java

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I'm supposed to create a simple program to run in a console for my Java class. The computers that it will be shown on are running Windows. I could really impress my professor if I included some color in the output.

Based on my searches, I'll need to download a library to accomplish this. It looks like Jansi is pretty straight-forward to use, but the instructions for installing seemed to be lacking (especially since I'm a newb).

After I download the .jar file, what do I do? I assume I double click on it to install and then include "import org.fusesource.jansi.AnsiConsole;" in my file. Is it that easy? Or am I missing some steps.

Thanks for any help!



 
Marshal
Posts: 67289
170
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Lainey Bonetto wrote:I could really impress my professor if I included some color in the output.


If one of my students did this above and beyond the requirements of an assignment, I'd be less than impressed. I'd suggest just sticking to the assignment.
 
Lainey Bonetto
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I appreciate your thoughts. Normally I'd stick to the assignment with any other professor, but I've had two other programming classes with him and know that he'd be pleased with the extra effort.
 
Bear Bibeault
Marshal
Posts: 67289
170
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I assume you'd just place the jar in the class path like any other.
 
Lainey Bonetto
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was able to get Jansi to work and I thought I'd share my solution in case anyone did a search here.

The file that you download can simply be placed in your jre/lib/ext folder and use the import statement shown above. No other contortions are necessary.
 
I'm gonna teach you a lesson! Start by looking at this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!