站内搜索: 请输入搜索关键词

当前页面: 开发资料首页JSP 专题在Linux 下配置JSP开发环境(一)

在Linux 下配置JSP开发环境(一)

摘要: 在Linux 下配置JSP开发环境(一)
HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <head> 无标题文档 </head> <body>

安装和配置J2SE JDK5.0

J2SE JDK5.0 安装

第一步:下载jdk5.0 For Linux文件

http://gceclub.sun.com.cn/staticcontent/html/j2se/1.5.0/j2se-netbeans.html

上面可以下载,如果没找到可以点这里下载

安装JDK5.0如下:

<table width="423" height="110" border="1"> <tr> <td width="413" height="52" bordercolor="#666666" bgcolor="#000000">
# cd /usr/local/
#chmod 755 jdk-1_5_0-rc-linux-i586-rpm.bin
#./jdk-1_5_0-rc-linux-i586-rpm.bin
</td> </tr> </table>

第二步设定J2SE JDK5.0

先到自己的目录下根据自己的shell在登陆文件中设定,

例如:使用root的用户,则用编辑软件编辑.bash_profile,如下:

<table width="442" border="1"> <tr> <th width="432" bordercolor="#666666" bgcolor="#000000" scope="col">
vi ~/.root_profile
</th> </tr> <tr> <th height="81" scope="row">
exprot JAVA_HOME =/usr/local/j2sdk1.5
exprot PATH=$PATH:$JAVA_HOME/bin
export CLASSPATH=.:$JAVA_HOME/lib.tools.jar
</th> </tr> </table>

设定完后在console下键入:

<table width="444" border="1"> <tr> <th width="434" height="66" bordercolor="#999999" bgcolor="#000000" scope="col">
#source ~/root_profile
#java -version 
</th> </tr> </table>

如果显示为1.5版本这为正常

第三步:测试J2SDK

我们来写一个HelloWorld.java程序,来测试J2SE JDK1.5是否正常安装

<table width="441" height="220" border="1"> <tr> <th width="431" height="17" bordercolor="#000000" class="style2" scope="col">
HelloWorld.java
</th> </tr> <tr> <th height="176" bordercolor="#808080" bgcolor="#CCCCCC" class="style2" scope="row">
public class HelloWorld{
public static void main(String[] args){
    System.out.println("Hello world");
       }
}
</th> </tr> </table>

最后在控制台运行:

<table width="445" border="1"> <tr> <th width="435" height="55" bordercolor="#999999" bgcolor="#000000" scope="col">
#javac HelloWorld.java
#java HelloWorld
</th> </tr> </table>
</body>

↑返回目录
前一篇: jsp研究(一)
后一篇: tomcat下的jsp和servlet的字符编码问题