-->
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.  [ 3 posts ] 
Author Message
 Post subject: Problem installing hibernate
PostPosted: Tue Feb 28, 2006 1:40 pm 
Newbie

Joined: Tue Feb 28, 2006 1:27 pm
Posts: 1
I am trying to install hibernate 3.1.2 and can't get it to build.

I unpacked the archive.
I copied JDBC driver (mysql) to the lib directory
I edited etc/hibernate.properties
I copied the antlr and junit jars to the ANT_HOME/lib directory
JAVA_HOME is C:\Program Files\Java\jdk1.5.0_06
ANT_HOME is c:\jwsdp-1.1\jakarta-ant-1.5.1

I ran ant eg and got the following messages:

C:\hibernate-3.1>ant eg
Buildfile: build.xml

BUILD FAILED
file:C:/hibernate-3.1/build.xml:101: taskdef class org.apache.tools.ant.taskdefs.optional.ANTLR cannot be found

Total time: 0 seconds

The problem here is that it can't find ANTLR even though it is in the location where hibernate told me to put it (ANT_HOME/lib)

I ran build eg and got the foillowing results:

C:\hibernate-3.1>build eg

C:\hibernate-3.1>java -cp "lib/ant-launcher-1.6.5.jar" org.apache.tools.ant.launch.Launcher -lib lib eg
Unable to locate tools.jar. Expected to find it in C:\Program Files\Java\jre1.5.0_06\lib\tools.jar
Buildfile: build.xml
[taskdef] Could not load definitions from resource checkstyletask.properties.
It could not be found.
[taskdef] Could not load definitions from resource clovertasks. It could not be found.

eg:
[echo] java.home=C:\Program Files\Java\jre1.5.0_06
[javac] Compiling 8 source files to C:\hibernate-3.1\eg

BUILD FAILED
C:\hibernate-3.1\build.xml:706: Unable to find a javac compiler;
com.sun.tools.javac.Main is not on the classpath.
Perhaps JAVA_HOME does not point to the JDK

Total time: 1 second

As you might have noticed, I added a couple echo lines to print out the java.home and java.class.path variables. For some reason when ant is run it uses the jre directory instead of the jdk directory.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 28, 2006 2:04 pm 
Beginner
Beginner

Joined: Fri Jul 30, 2004 2:53 pm
Posts: 33
Location: Washington, DC
Why are you trying to build Hibernate? To install it, you can just use the binary distribution. You only need to build it if you are trying to modify the Hibernate code.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 14, 2006 8:48 am 
Newbie

Joined: Fri Jul 14, 2006 8:23 am
Posts: 3
To do all this:

copy from Hibernate* dir
lib/antlr-*.jar
lib/junit-*.jar

files into ant*/lib

(0) Make sure your hibernate.properties in etc/ have been set properly. I believe this will allow hibernate to connect to the database...
e.g. for the "H2" Database, I've added this entry because it's not yet there.

Code:
## H2

hibernate.dialect org.hibernate.dialect.H2Dialect
hibernate.connection.driver_class org.h2.Driver
hibernate.connection.url jdbc:h2:test;hsqldb.default_table_type=cached
hibernate.connection.username sa
hibernate.connection.password

For your database uncomment & modify the properties to the proper setting.

(1) To make a new Hibernate "jar" with your java class inside
make sure your place your .java file at the right place within:
e.g. for "H2" database place the H2Dialect.java (H2Dialect.txt) within dir
src\org\hibernate\dialect\H2Dialect.java

type/run "ant" at the Hibernate* dir
This should create a new Hibernate "jar" with your java class inside.
(It seems all the common database .java file is there, likely you do NOT need to compile & make a new Hibernate "jar" file)

(2) "ant eg"
To run this, copy the new or existing Hibernate "jar" into Hibernate*/lib dir
lib/hibernate*.jar

copy also your JDBC driver into the Hibernate*/lib dir
e.g. for "H2" database, the file is:
lib/h2.jar

now run "ant eg"

in my setting & database it runs ok.

(3) "ant info" - for hibernate-3.1.3 build.xml
it has a target "info"
Code:
    <target name="info" description="Echo system properties">
      <echoproperties/>
   </target>


This should display the properties within this build.xml...

Hope this helps.

_________________
:-)
James Liong
http://members.optusnet.com.au/~liongs


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.