Can't import Java class?
11,761
As comments above indicate, it is possible that your ConnectDB
is not public, in order to use that close outside of the its package
, it must be declared public
Please refer to: Access control documentation
EDITED: (Solution)
The problem is that packages are case sensitive, you have a different case in both packages declaration.
inside the ConnectDB class you maybe have cis
in lower case.
Author by
Admin
Updated on June 04, 2022Comments
-
Admin almost 2 years
The screenshot is the error I am receiving. I am trying to use the class ConnectDB contained within the package CIS4362Connect1, in the class AdminManager in the package myconnectoracle. Why can't I import this class?
-
Admin about 11 yearsConnectDB is most definitely declared as public. I had updated this in the comments and I changed some things based on the users' recommendation. Here is a screenshot, showing where I moved the classes, with a new error. i.imgur.com/YgvE8jA.png
-
Garis M Suero about 11 yearsThen it doesn't exist... or it is in a different project not related to this project.
-
Admin about 11 yearsI wasn't sure how to post the code to here, so I had to take another screenshot. I hope it isn't too much of an inconvenience. i.imgur.com/3oS9f8J.png
-
Admin about 11 yearsYou are correct! I had no idea and was slamming my head against the desk. Thank you so much!