-->
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.  [ 8 posts ] 
Author Message
 Post subject: error occurs when running the hibernate build file
PostPosted: Tue Jan 11, 2005 1:18 pm 
Newbie

Joined: Tue Jan 11, 2005 12:52 pm
Posts: 17
[b]Hibernate version:[2.1]

[b]Full stack trace of any exception that occurs:[/bC:\hibernate-2.1>set JDBC_DRIVER=C:\mysql\mysql-connector-java-3.0.8-stable-bin.jar

C:\hibernate-2.1>java -cp "lib/ant-1.5.3.jar;lib/ant-optional-1.5.3.jar;lib/junit-3.8.1.jar;lib/xerces-2.4
.0.jar;C:\Program Files\Java\jdk1.5.0/lib/tools.jar" org.apache.tools.ant.Main -Ddriver.jar=C:\mysql\mysql
-connector-java-3.0.8-stable-bin.jar
Buildfile: build.xml
[taskdef] Could not load definitions from resource clovertasks. It could not be found.


splash:

init:
[echo] Build Hibernate-2.1 (2005-01-11 04:04:44)

compile:
[javac] Compiling 486 source files to C:\hibernate-2.1\build\classes
[javac] C:\hibernate-2.1\src\net\sf\hibernate\cfg\Configuration.java:388: as of release 1.5, 'enum' is
a keyword, and may not be used as an identifier
[javac] (try -source 1.4 or lower to use 'enum' as an identifier)
[javac] Enumeration enum = jarFile.entries();

im getting a load more of these errors associated with the " 'enum' as an identifier"
]

[b]Name and version of the database you are using:[/MySQL 1.4]

hi,

i ran the build file a few times and made sure that the relivant files were in the locations specified above. i keep getting the above errors. is this a problem with my java version (1.5) ?

cheers for the help


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 11, 2005 2:51 pm 
Expert
Expert

Joined: Fri Nov 07, 2003 4:24 am
Posts: 315
Location: Cape Town, South Africa
Enum is a reserved keyword in jdk 1.5, so it breaks code that makes use of the commons-lang Enum class.

Either use a 1.4 compiler, or modify the ant file as follows:

<javac source="1.4" ....... >
</javac>


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 11, 2005 3:07 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
please use a newer version of hibernate2 if you want it to compile with an jdk 1.5. (note: it can *run* without problems on jdk 1.5)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 12, 2005 6:08 am 
Newbie

Joined: Tue Jan 11, 2005 12:52 pm
Posts: 17
do you know when version 3 of hibernate will be ready for release? will it support java 1.5?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 12, 2005 6:14 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
Hibernate2 runs fine under JDK 1.5, and so will Hibernate3.

Which version are you compiling ? I can't find the enum warnings you are referring to - look to me you are using a old Hibernate 2.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 12, 2005 6:30 am 
Newbie

Joined: Tue Jan 11, 2005 12:52 pm
Posts: 17
this is the version of hibernate im running: 2.1.7c,
ive tried it on a machine running 1.4.2 and it builds successfully and creates the hibernate2.jar file.

the hibernate2.jar i was using previously, was the one that came with the hibernate-2.1.7c.zip file that i downloaded from the hibernate.org website.

is there any classpaths that are needed to be set up with hibernate as i havnt seen any specified.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 12, 2005 6:48 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
Sorry, there have actually just been a minor update in CVS since 2.1.7 which removes this and the line your errors indicate is now:
Enumeration entries = jarFile.entries();
and *not*
Enumeration enum = jarFile.entries();

But as suggested by others - use source level 1.4 and it will work fine.
Or even just use the hibernate.jar as is, no need to recompile it (AFAIK) to make it work under 1.5

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 12, 2005 8:19 am 
Newbie

Joined: Tue Jan 11, 2005 12:52 pm
Posts: 17
cheers max,

ill give that a go and see how it works out.


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