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.

Share:
11,761
Admin
Author by

Admin

Updated on June 04, 2022

Comments

  • Admin
    Admin almost 2 years

    IDE Snapshot

    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
    Admin about 11 years
    ConnectDB 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
    Garis M Suero about 11 years
    Then it doesn't exist... or it is in a different project not related to this project.
  • Admin
    Admin about 11 years
    I 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
    Admin about 11 years
    You are correct! I had no idea and was slamming my head against the desk. Thank you so much!