Rudresh Mehta
Rudresh Mehta

Reputation: 99

The package org.apache.poi.ss.usermodel is accessible from more than one module: poi, poi.ooxm

in above all reference for this question it is not solved and dont give maven because not doing in maven. error is error can be seen imageThe package org.apache.poi.ss.usermodel is accessible from more than one module: poi, poi.ooxm in both error

i have to use both poi and poi--ooxml, please run this code i need to use it. even this code is sopied from the internet itself and there are many blogs who are showing this type code and it is the actual my requirement but its not working.

Upvotes: 5

Views: 10644

Answers (4)

Swapnil G Thaware
Swapnil G Thaware

Reputation: 877

This issue is due to multiple jars versions present in your eclipse setup. Try deleting old/new versions depending on your requirement and try it will work.

Upvotes: 0

If someone have same issue just download new version of POI, old one is not compatible with new versions of java

Upvotes: 1

Aly Abdelaal
Aly Abdelaal

Reputation: 322

just in module class add all lib in requires

module MyProjct {
    requires poi;
    requires poi.excelant;
    requires poi.ooxml;
    requires poi.ooxml.schemas;
}

Upvotes: 0

Aukta
Aukta

Reputation: 413

I faced the same issue and figured out the solution. it's a little late but may help someone else facing the same problem. in your module remove "requires poi" and just keep requires poi.ooxml;

module com.example.MyModlue {
  //other require statement goes here
   requires poi.ooxml;
}

now in your code

in place of using (CellType.NUMERIC) import org.apache.poi.ss.usermodel.CellType;

for getting the cell type use (cell.getCellTypeEnum().NUMERIC) where cell if of type XSSFCell

import org.apache.poi.xssf.usermodel.XSSFCell;

Hope this helps. :)

Upvotes: 0

Related Questions