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

后端 未结 2 909
自闭症患者
自闭症患者 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)

    0 讨论(0)
  • 2021-01-20 18:20

    Ran into this issue when creating a Runnable JAR via Eclipse (Mars).

    In the Jar generator I was setting the library handling option to

    Package required libraries into generated JAR

    but switching to

    Extract required libaries

    solved the issue

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