作为开发环境,如果采用经典配置:JBuilder+Weblogic+Oracle,自是得心应手,但价格是惊人的。此配置主要是针对大型或超大型应用,硬件要求也很高,针对国内以中小型应用为主的现况,不作推荐。

虽然国内开发者早已习惯了D版,但笔者以为还是防患于未然,应尽早加入OpenSource行列,促进国内软件业的发展。
本文所推荐的Eclipse、JBoss、MySQL均是名气很高的开源软件,并且非常实用。

1、JDK:到http://java.sun.com下载,推荐使用J2SDK1.4.X

2、JBoss:到http://www.jboss.org下载,笔者使用jboss-3.0.4_tomcat-4.0.6

3、MySQL:到http://www.mysql.com下载,笔者使用mysql-4.0.13,另须下载MySQL Control Center(图形化管理工具),到http://sourceforge.net/projects/mmmysql/下载MySQL的JDBC驱动程序,如mm.mysql-2.0.14-you-must-unjar-me.jar

4、Eclipse:到http://www.eclipse.org下载,最新版本为3.0M8,如果是新手推荐下载2.1.2和中文包(2.1.2_Translations)。到http://www.objectlearn.com/下载lomboz(此插件开发J2EE必需),需要注意的是lomboz的版本必须与eclipse版本一致,否则不正常。

环境设置(以win2000下D盘作根目录为例):

1、JDK的安装配置在此不再说明。

2、将JBoss解压到D:/,将MySQL的JDBC驱程包中的mm.mysql-2.0.14-bin.jar解压到D:/jboss-3.0.4_tomcat-4.0.6/server/default/lib中,再将D:/jboss-3.0.4_tomcat-4.0.6/docs/examples/jca目录下的mysql-service.xml拷贝到D:/jboss-3.0.4_tomcat-4.0.6/server/default/deploy目录下,找到相应段落并作如下修改:

<attribute name="JndiName">MySqlDS</attribute> 

<attribute name="ManagedConnectionFactoryProperties"> 
<properties> 
<config-property name="ConnectionURL" type="java.lang.String">jdbc:mysql://localhost:3306/test</config-property> 
<config-property name="DriverClass" type="java.lang.String">org.gjt.mm.mysql.Driver</config-property> 
<!--set these only if you want only default logins, not through JAAS --> 
<config-property name="UserName" type="java.lang.String">root</config-property> 
<config-property name="Password" type="java.lang.String"></config-property> 
</properties> 
</attribute>


3、安装MySQL和MySQL Control Center,到mysql/bin目录中启动mysqld-nt.exe,即开启mysql服务。使用MySQL Control Center很方便地进行管理(类似SQL Server)。

4、将Eclipse(以3.0M8为例)解压到D:/,再将lomboz包中plugins目录中的内容解压到D:/Eclipse/plugins中,启动eclipse。(1)window--preferences--lomboz,设置JDK Tools.jar,Server Definitions--Server types:JBoss 3.0--Application Server Directory:D:/jboss-3.0.4_tomcat-4.0.6;Classpath Variable:D:/jboss-3.0.4_tomcat-4.0.6(2)window--Customize Perspective--Shortcuts--New--Java,勾选lomboz J2EE Wizards。

开发环境总算是设置好了,下面就出发吧!
posted on 2004-11-20 11:28  rickyxing  阅读(121)  评论(0编辑  收藏  举报