Win a copy of Head First Android this week in the Android forum!
  • 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:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

How to read the data in excel with poi jar?

 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have downloaded the poi jar and extract it in /home/debian/workspace.



I want to use the code in the url
https://www.javatpoint.com/how-to-read-excel-file-in-java.

Now enter into my jshell:


How to fix ` import org.apache.poi.ss.usermodel.Cell;   `  according to my file structure?




 
Saloon Keeper
Posts: 7174
166
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are you adding the POI jar (at least the main one) to the classpath? If not, see https://docs.oracle.com/javase/9/jshell/external-code.htm#JSHEL-GUID-D0BED087-AD44-4048-B37D-054308C64390 for how to do that.
 
peng shan
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My java environment setting:



Files structure:


Can't import it!

 
Tim Moores
Saloon Keeper
Posts: 7174
166
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The page I linked to explains how to set the classpath for jshell - you don't seem to be doing that. And the CLASSPATH variable doesn't include the POI jar file, either.
 
peng shan
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It is no use to write

or


in my jshell.
 
You showed up just in time for the waffles! And 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
reply
    Bookmark Topic Watch Topic
  • New Topic