why `java.lang.SecurityException: Prohibited package name: java` is required?

前端 未结 8 676
挽巷
挽巷 2020-12-03 16:56

I created a class \"String\" and placed that in package \"java\" [ actually i wanted to create java.lang to see which class is loaded by classLoader as

8条回答
  •  借酒劲吻你
    2020-12-03 17:50

    Probably during refactoring/patch applying/etc. you have added to package name word 'java', which is usually a folder that contains packages.

    So you could end with the structure: src->main->java->java.com.yourpackage.name

    It might also happens for test: src->main->test->java->java.com.yourpackage.name

    Verify it in your IDE and remove "java." part

提交回复
热议问题