• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Question about installing Jansi to use with Java

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!



 
Sheriff
Posts: 67747
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Sheriff
Posts: 67747
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 didn't say it. I'm just telling you what this tiny ad said.
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic