“java.lang.SecurityException: Prohibited package name: java.sql” error happen only when executing outside of Eclipse

后端 未结 2 908
自闭症患者
自闭症患者 2021-01-20 17:41

I am writing a Topic Modeling program using Apache Tika to extract the text contents from other file type. Actually It run perfectly on Eclipse. But when I export to JAR fil

2条回答
  •  隐瞒了意图╮
    2021-01-20 18:18

    The 'prohibited package name' is thrown, when you are using a class of a package starting with 'java.' that is not found in your rt.jar. Either you created such a class yourself, or you have a .jar file containing such a class in your classpath.

    If it's the former, put the class in another package. If it's the latter, try to find the .jar file containing this class (e.g. print out the classpath found in the system property java.class.path)

提交回复
热议问题