0

I'm learning Hibernate. This is my day 1 and I'm watching this video on YouTube: Hibernate Tutorial | Practical. I did exactly what the tutor said but my program is not able to recognize:

import org.hibernate.Session;
import org.hibernate.SessionFactory;

It says: Package org.hibernate does not exists.

Here is my pom.xml

...
<dependencies>
    <dependency>
        <groupId>mysql</groupId>
        <artifactId>mysql-connector-java</artifactId>
        <version>8.0.26</version>
    </dependency>
    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-core</artifactId>
        <version>4.1.6.Final</version>
    </dependency>
</dependencies>

Here is the screenshot:

enter image description here

I can see hibernate-core-5.5.6.Final.jar on the left panel but when I hover on that, the tooltip says:

Dependency not yet downloaded. Build project to correct errors.

Yes, I Clean-Build it again and again. I googled a lot but none of the answer is working. Please help.

skomisa
  • 16,436
  • 7
  • 61
  • 102
Tanzeel
  • 4,174
  • 13
  • 57
  • 110
  • [1] I just tried this on NB 12.4, copying the `` from your question. The Maven build worked fine for me, so there is nothing obviously wrong. [2] Update your question to show the entire **pom.xml**. [3] Also show the entire build output from the **Output** window. Perhaps there was a problem during the downloading? [4] I realize that you are following a tutorial, but Hibernate 4.1.6 is nine years old. Perhaps try a more recent version of Hibernate, or find a more recent tutorial that uses NetBeans rather than Eclipse? – skomisa Aug 18 '21 at 06:15
  • @skomisa I tried the latest version of `Hibernate` and it worked. But also I restarted NetBeans after that. I don't know which trick actually solved the issue. But you can add these two in the answer. I'll accept that and close this question today itself. – Tanzeel Aug 18 '21 at 12:11
  • Also I asked you one more question. I'm still not able to add plugin for Hibernate in NetBeans. I'll try few more things or else I'll open a new question for that and I'll pull you. Please pitch in. :-) – Tanzeel Aug 18 '21 at 12:13
  • It's good that you resolved this, so please post your own answer and accept it. That's helpful for the community, and more appropriate than me posting an answer. – skomisa Aug 18 '21 at 18:55

0 Answers0