Hibernate返回错误“必须设置类路径或将其恢复为默认值”。 [英] Hibernate returns error "Class path must be set or restored default"

查看:164
本文介绍了Hibernate返回错误“必须设置类路径或将其恢复为默认值”。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是刚接触基于Hibernate技术的Java应用程序的人。我在安装系统时遇到一些问题。我已安装在朋友系统中。我在Eclipse Juno(便携式)中安装了JBOSS Tools(仅Hibernate工具)。



我只是将该文件夹复制到了系统中,然后运行Eclipse.exe文件。并且它运行得很顺利,我正在尝试从休眠角度创建新的Hibernate配置文件。 b


必须设置或恢复默认的类路径


解决方案

您需要添加数据库您的类路径的驱动程序



1)下载数据库驱动程序(例如,如果您尝试连接到MySQL,则可以从 http://dev.mysql.com/downloads/connector/j/



2)指向它,方法是单击添加外部jar,然后从将其下载到

的位置进行选择,首先将其添加到项目中,然后通过添加罐子(推荐)进行选择


I am new to Java application based on Hibernate technology. I get some problems in installing my system. I am installed in my friends system. I installed JBOSS Tools (in that only Hibernate tools) in Eclipse Juno (Portable).

I just copied that folder in to my system and I run the Eclipse.exe file and it runs smooth and I am trying to create new Hibernate Configuration file in hibernate perspective.

But I got below error:

Class path must be set or restored default

解决方案

You need to add the database driver to your classpath

1) Download the driver for your database (e.g. if you are trying to connect to MySQL you can get it from http://dev.mysql.com/downloads/connector/j/ )

2) Point to it by clicking 'Add external jars' and selecting it from the place you downloaded it to OR First add it to the project, and then select it by through 'Add Jars' (recommended)

这篇关于Hibernate返回错误“必须设置类路径或将其恢复为默认值”。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆