选择显示字体大小

windows 2000 server下j2ee+jdk+ant的配置

xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /> 


1。所先下载j2sdkee1.3和j2sdk1.4,jakarta-ant1.3,
其中j2sdkee和j2sdk1.4可以从www.java.sun.com免费下载。

2。点击安装,我这边是安装在d盘下

3。进行环境设置:
右击我的电脑/属性/高级/环境变量/系统变量
点击path,在其变量值后面加入:;d:\j2sdk\bin;d:\j2sdkee\bin;d:\jakarta-ant1.3\bin;
点击classpath,在其变量值后面加入:;d:\j2sdk\lib\dt.jar;d:\j2sdk\lib\tools.jar;d:\j2sdk\jre\lib\rt.jar;d:\j2sdkee\lib\j2ee.jar;
其中d:\j2sdkee为j2sdkee的安装路径,d:\j2sdk和d:\jakarta=ant1.3同样。

4。测试

在ie中输入:http://localhost:8000如果安装成功就会出现j2ee的介面;
如果不行,可能是在你电脑上的8000端口被其它软件占用了,发生了冲突。这时你就要改一下进入d:\j2sdkee\config中把web.properties中的http.port=8000的8000改成其它没有冲突端口号。

5。启动j2ee

进入命令提示符,输入:start j2ee -verbose启动j2ee
输入:start deploytool启动应用程序配置工具进行配置。
下而一个例子:
home接口:

import java.rmi.remoteexception;
import java.io.serializable;
import javax.ejb.createexception;
import javax.ejb.ejbhome;
public interface converterhome extends ejbhome
{
converter create() throws remoteexception,createexception;

}
remote接口:

import javax.ejb.ejbobject;
import java.rmi.remoteexception;
import java.math.*;
public interface converter extends ejbobject
{
public bigdecimal dollartoyen(bigdecimal dollars)throws remoteexception;
public bigdecimal yentoeuro(bigdecimal yen)throws remoteexception;
}

bean类:

import java.rmi.remoteexception;
import javax.ejb.sessionbean;
import javax.ejb.sessioncontext;
import java.math.*;
public class converterbean implements sessionbean
{
bigdecimal yenrate=new bigdecimal("121.6000");
bigdecimal eurorate=new bigdecimal("0.0077");
public bigdecimal dollartoyen(bigdecimal dollars)
{
bigdecimal result=dollars.multiply(yenrate);
return result.setscale(2,bigdecimal.round_up);
}
public bigdecimal yentoeuro(bigdecimal yen)
{
bigdecimal result=yen.multiply(eurorate);
return result.setscale(2,bigdecimal.round_up);

}
public converterbean() {}
public void ejbcreate(){}
public void ejbremove() {}
public void ejbactivate() {}
public void ejbpassivate() {}
public void setsessioncontext(sessioncontext sc) {}
}

client程序:

import javax.naming.context;
import javax.naming.initialcontext;
import javax.rmi.portableremoteobject;
import java.math.bigdecimal;
import converter;
import converterhome;
public class converterclient
{
public static void main(string[] args)
{
try{
context initial=new initialcontext();
object objref=initial.lookup("java:comp/env/ejb/simpleconverter");
converterhome home=(converterhome)portableremoteobject.narrow(objref,converterhome.class);
converter currencyconverter=home.create();
bigdecimal param=new bigdecimal("100.00");
bigdecimal amount=currencyconverter.dollartoyen(param);
amount=currencyconverter.yentoeuro(param);
system.exit(0);

}
catch (exception ex)
{
system.err.println("caught an unexpected exception!");
ex.printstacktrace();
}
}
}


 


关键字 本文所属关键字

相关 与本文相关文章

分类 所有文章关键字导航

源码编程相关

Java   Asp   PHP   .Net   XML   C/C++   CGI   VB   Jsp   J2ee   J2se   J2me   EJB   Servlet   Tomcat   Resin   Struts   Weblogic   Eclipse   ANT   GUI   JMS   Web servise   IDEA   Webphere   Hibernate   Spring   Jboss   Applet   Swing   Socket   Javamail   Perl   Ajax   P2P   安全   模式   框架   测试   开源   游戏

SQL数据库相关

My-SQL   Ms-SQL   Access   DB2   Oracle   Sybase   SQLserver   索引   存储过程   加密   数据库   分页   视图  

手机无线相关

3G   Wap   CDMA   GRPS   GSM   IVR   彩信   短信   无线   增值业务

网页设计制作相关

HTML   CSS   网页配色   网页特效   Javascript   VBscript   Dreamweaver   Frontpage   JS   Web   网站设计

网站建设推广相关

建站经验   网站优化   网站排名   推广   Alexa

操作系统/服务器相关

Windows XP   Windows 2000   Windows 2003   Windows Me   Windows 9.x   Linux   UNIX   注册表   操作系统   服务器   应用服务器

图形图像多媒体相关

Photoshop   Fireworks   Flash   Coreldraw   Illustrator   Freehand   Photoimpact   多媒体   图形图像

标准 网站致力的规范

Valid CSS!

无不良内容,无不良广告,无恶意代码

Valid XHTML 1.0 Transitional

creativecommons