-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 
Author Message
 Post subject: Unable to compile HibernateUtil.java from ref tutorial
PostPosted: Wed Apr 11, 2007 12:43 pm 
Newbie

Joined: Wed Apr 11, 2007 12:30 pm
Posts: 3
I am trying to go through the tutorial in the reference manual for hibernate 3.2.3. When i try to compile HibernateUtil.java it gives me an error: "package org.hibernate does not exist
import org.hibernate.*;"

I have downloaded hibernate, unziped it, i also did a build so that the hibernate class files would be available. They are located under C:\hibernate\build\classes\org\hibernate. The code i use is from the reference manual.
I am not sure what's going on. I even tried to put the whole path in the import statement but nothing seems to work. Any ideas ?
Thank you.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 11, 2007 12:49 pm 
Expert
Expert

Joined: Tue Jul 11, 2006 10:21 am
Posts: 457
Location: Columbus, Ohio
You did a build on the Hibernate source to include it in your project? I hope that's not what you're saying, because using jar files in a project is "Java 101 - Introduction to Java" type stuff. The hibernate jar has to be on your project's classpath.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 11, 2007 12:56 pm 
Newbie

Joined: Wed Apr 11, 2007 12:30 pm
Posts: 3
First i tried to compile my code without building the hibernate package.
Then, i thought that maybe i needed to create the class files in the hibernate package. So i built it in the hibernate package not in my source code workspace.


Top
 Profile  
 
 Post subject: put hibernate3.jar in classpath and it worked.
PostPosted: Wed Apr 11, 2007 3:31 pm 
Newbie

Joined: Wed Apr 11, 2007 12:30 pm
Posts: 3
That's what i was trying to figure out, if and what i needed to put in my classpath. I had the classpath set up for only the location of hibernate.
Thanks .


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 12, 2007 2:30 am 
Newbie

Joined: Mon Mar 26, 2007 3:33 am
Posts: 18
you need to copy your hibernate.jar to your context classpath.

i.e; if u r using Tomcat it should be WEB-INF/lib/

you need to copy few more jars from extracted hibernate folder.
you can find all jars which is required to add in Hibernate doc.


Dont forget to rate, if this will help u out


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.