之前在网上看了很多关于这方面的文章,经过自己的一些测试,终于……,嘿,结果你也知道,OK了,开心地说,所以想给大家分享分享劳动果实!
其实我也跟大家一样,是一个喜欢追求时尚的爷们,所以当前配置是Eclipse3.1+JBoss4.0.0,说实在的,我对那些所谓的汉化版是较为鄙视的,学学E文也好嘛,不要老让老外们牵着鼻子,做什么事都迟他们一步,俺们能看懂E文,老外们看不懂中文(说实在的,中文比E文高级多了,所以也更难学),自然他们就会慢慢地跟着俺们的屁股追了,废话不多说,现在让我们切入正题吧!(有什么不懂的,记得给我回复哦)
这个配置要分四步走,具体如下:
首先,巧妇难为无米之炊,没有工具谈整合开发,可要比叫男人生小孩痛苦得多。所以,我们都下载相应工具。
Eclipse3.1下载:http://www.eclipse.org/downloads/index.php(若大的3.1,够醒目吧,哈!)
JBoss4.00下载:http://www.jboss.org/products/jbossas/downloads(哈,什么版本都有吧)
Lomboz下载:http://forge.objectweb.org/project/showfiles.php?group_id=97(很多版本,择优吧)
以上的三个网站,希望大家收藏起来,以后如果有新的版本,都可以在这上面看到,更新方便得多哦。
其次,将三个宝(压缩包)分别解压,eclipse-SDK-3.1-win32.zip解压至D:\Eclipse3.1目录(别告诉我你没有D盘),jboss-4.0.0.zip 解压至D:\jboss-4.0.0目录
再次,搭建Eclipse+Lomboz环境。
可能这个时候有朋友对Lomboz这东东还不太理解(俺当初就菜成这副模样,不骗你),其实呢,在百度(严重支持国货)里Search一下就知道了,它是一个通用插件,通过它,Eclipse可以整合各种服务器,不过这东东好像不太好配置,主要是因为版本问题,还好我运气没那么背,第一次就捡狗屎运的配置成功了(而且还在第二天找了个GF),这里有两个搭配(emf-sdo-runtime-I200412160800.zip+org.objectweb.lomboz_3.1.0.N20041219.zip 和 emf-sdo-runtime-I200503181320.rar+org.objectweb.lomboz_3.1.0.N20050106.zip),至于选择哪种就随你的便了,不过后一个版本要靠新一些(Why? Ask me? See the data!),然后给两个ZIP文件解压,将features目录下的所有内容拷贝到D:\Eclipse3.1\features目录,将plugins目录下的所有内容拷贝到D:\Eclipse3.1\plugins目录。(关键步骤到了)这时,进入D:\Eclipse3.1\configuration,删除org.eclipse.update文件夹(很多配置好的却没有显示都是没删这东东惹的祸),OK,启动Eclipse,选择菜单栏的Window,在下拉菜单中选择Preferences,弹出的Preferences属性框中,你看到了什么??是不是多了个Lomboz配置选项,对就这玩意,选择它,配置tool.jar的路径,我的配置是C:\Java\jdk1.5.0_04\lib\tools.jar(偶的JDK1.5装在C:\Java\jdk1.5.0_04目录下),再展开Lomboz项,这时你会看到Server Definitions,这个才是真正配置启动服务器类型的选项(例如JBoss、Weblogic、Tomcat、Resin、Websphere),下面就专门来讲解这个配置。
Server Definitions配置详解:
Server types:在下拉菜单中选择需要配置的服务器(有版本区别),在此我选择JBOSS 4.0.0
注:Server types下拉菜单默认最高支持到JBOSS 3.2.x,这方面的配置见附属说明。
Application Server Directory:D:/jboss-4.0.0(你的Jboss安装路径)
Classpath Variable:D:/jboss-4.0.0(你的Jboss安装路径)
其它项,全取默认值
如果你不幸是用Linux的朋友,哦,对不起,忘记事先说明了,偶用的是Windows(晕死)平台,兄弟们,这可是偶摸了一天两夜才难产出来的自创性文章,如果其中某环节出了什么差池,可别扁我哦!
附属说明:在D:\Eclipse3.1\plugins\com.objectlearn.jdt.j2ee_3.0.1\servers目录下有一系列配置文件,你可以在此目录下新建一个jboss400.server的文件,用Editplus打开它编辑,文件内容如下:
<serverDefinition
name="JBOSS 4.0.0"
ejbModules="true"
webModules="true"
earModules="true">
<property id="serverRootDirectory"
label="Application Server Directory:"
type="directory"
default="D:/jboss-4.0.0" />
<property id="serverAddress"
label="Address:"
type="string"
default="127.0.0.1" />
<property id="serverPort"
label="Port:"
type="string"
default="8080" />
<property id="serverConfig"
label="Server Configuration (minimal/default/all):"
type="string"
default="default" />
<property id="classPathVariableName"
label="Classpath Variable Name:"
type="string"
default="JBOSS400" />
<property id="classPath"
label="Classpath Variable:"
type="directory"
default="D:/jboss-4.0.0" />
<serverHome>${serverRootDirectory}</serverHome>
<webModulesDeployDirectory>${serverRootDirectory}/server/${serverConfig}/deploy</webModulesDeployDirectory>
<ejbModulesDeployDirectory>${serverRootDirectory}/server/${serverConfig}/deploy</ejbModulesDeployDirectory>
<earModulesDeployDirectory>${serverRootDirectory}/server/${serverConfig}/deploy</earModulesDeployDirectory>
<jndiInitialContextFactory>org.jnp.interfaces.NamingContextFactory</jndiInitialContextFactory>
<jndiProviderUrl>jnp://${serverAddress}:1099</jndiProviderUrl>
<startClass>org.jboss.Main</startClass>
<startWorkingDirectory>${serverRootDirectory}/bin</startWorkingDirectory>
<startVmParameters></startVmParameters>
<startProgramArguments>-c ${serverConfig}</startProgramArguments>
<stopClass>org.jboss.Shutdown</stopClass>
<stopWorkingDirectory>${serverRootDirectory}/bin</stopWorkingDirectory>
<stopVmParameters></stopVmParameters>
<stopProgramArguments>-S</stopProgramArguments>
<serverClassPath>
<jar type="variable">JDK_TOOLS</jar>
<jar type="variable">${classPathVariableName}/bin/run.jar</jar>
<jar type="variable">${classPathVariableName}/bin/shutdown.jar</jar>
<jar type="variable">${classPathVariableName}/client/jboss-j2ee.jar</jar>
<jar type="variable">${classPathVariableName}/server/${serverConfig}/lib/javax.servlet.jar</jar>
<jar type="variable">${classPathVariableName}/lib/jboss-boot.jar</jar>
<jar type="variable">${classPathVariableName}/lib/jboss-system.jar</jar>
<jar type="variable">${classPathVariableName}/lib/concurrent.jar</jar>
<jar type="variable">${classPathVariableName}/server/${serverConfig}/lib/jboss.jar</jar>
<jar type="variable">${classPathVariableName}/server/${serverConfig}/lib/jnpserver.jar</jar>
<jar type="variable">${classPathVariableName}/server/${serverConfig}/lib/jpl-pattern.jar</jar>
<jar type="variable">${classPathVariableName}/server/${serverConfig}/lib/jpl-util.jar</jar>
<jar type="variable">${classPathVariableName}/server/${serverConfig}/lib/jboss-transaction.jar</jar>
<jar type="variable">${classPathVariableName}/server/${serverConfig}/lib/bcel.jar</jar>
<jar type="variable">${classPathVariableName}/lib/jdom.jar</jar>
<jar type="variable">${classPathVariableName}/lib/xercesImpl.jar</jar>
<jar type="variable">${classPathVariableName}/lib/xml-apis.jar</jar>
<jar type="variable">${classPathVariableName}/lib/gnu-regexp.jar</jar>
<jar type="variable">${classPathVariableName}/lib/getopt.jar</jar>
</serverClassPath>
<clientClassPath>
<jar type="variable">${classPathVariableName}/client/jboss-j2ee.jar</jar>
<jar type="variable">${classPathVariableName}/client/jnp-client.jar</jar>
<jar type="variable">${classPathVariableName}/client/jboss-client.jar</jar>
<jar type="variable">${classPathVariableName}/client/jboss-common-client.jar</jar>
<jar type="variable">${classPathVariableName}/client/jbosssx-client.jar</jar>
<jar type="variable">${classPathVariableName}/client/log4j.jar</jar>
<jar type="variable">${classPathVariableName}/client/jnet.jar</jar>
<jar type="variable">${classPathVariableName}/server/default/lib/jnpserver.jar</jar>
<jar type="variable">${classPathVariableName}/client/jboss-jaas.jar</jar>
</clientClassPath>
<projectClassPath>
<jar type="variable">JDK_TOOLS</jar>
<jar type="variable">${classPathVariableName}/bin/run.jar</jar>
<jar type="variable">${classPathVariableName}/bin/shutdown.jar</jar>
<jar type="variable">${classPathVariableName}/client/jboss-j2ee.jar</jar>
<jar type="variable">${classPathVariableName}/server/${serverConfig}/lib/javax.servlet.jar</jar>
<jar type="variable">${classPathVariableName}/lib/jboss-boot.jar</jar>
<jar type="variable">${classPathVariableName}/lib/jboss-system.jar</jar>
<jar type="variable">${classPathVariableName}/lib/concurrent.jar</jar>
<jar type="variable">${classPathVariableName}/server/${serverConfig}/lib/jboss.jar</jar>
<jar type="variable">${classPathVariableName}/server/${serverConfig}/lib/jnpserver.jar</jar>
<jar type="variable">${classPathVariableName}/server/${serverConfig}/lib/jpl-pattern.jar</jar>
<jar type="variable">${classPathVariableName}/server/${serverConfig}/lib/jpl-util.jar</jar>
<jar type="variable">${classPathVariableName}/server/${serverConfig}/lib/jboss-transaction.jar</jar>
<jar type="variable">${classPathVariableName}/server/${serverConfig}/lib/bcel.jar</jar>
</projectClassPath>
<adminTool>
<web><deploy /><undeploy />
</web>
<ejb><deploy /><undeploy />
</ejb>
<ear><deploy /><undeploy />
<webModule><deploy /><undeploy />
</webModule>
<ejbModule><deploy /><undeploy />
</ejbModule>
</ear>
</adminTool>
<adminToolPath>
</adminToolPath>
</serverDefinition>