java.lang.NoClassDefFoundError: org/apache/poi/ss/usermodel/Row

前端 未结 1 1967
悲&欢浪女
悲&欢浪女 2021-01-23 12:08

I\'ve made a small application that reads from an excel (xls file) and displays the contents to a JTable. Everything is working fine in eclipse, yet when I create the jar file a

1条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-23 12:19

    Probably you are getting this only when you are running your jar because the dependencies are not available/packaged inside of it.

    Try generating a "fat jar" (also known as uber-jar), it will package all your dependencies inside the jar:

    
        
            
                org.apache.maven.plugins
                maven-shade-plugin
                
                    
                        package
                        
                            shade
                        
                    
                
                
                    YOUR_JAR_FINAL_NAME
                
            
        
    
    

    Documentation related to the maven-shade-plugin can be found in here

    UPDATE: Since you are using a runnable jar file, you can follow this section of the documentation related to Executable Jars

    0 讨论(0)
提交回复
热议问题