java configure_配置java环境

ObjectiveInstall Java 2 SDK, Standard Edition, and configure the “Path” and “Classpath” properties of operating systems to run ‘java’, ‘javac’ and other j2sdk commands correctly in console windows.

Directions1、Install java 2 SDK, Standard Edition

ef6ecdece60f7d8a3fdf59674f8f14af.png

as default options

7f34efd96c1a3583f44def4fc3652c9e.png

the installation directory is as follow:

349351d33dac079b80f8db939fe247c7.png

2、configure the Path and Classpath properties of OS with two methods

A. configuration method:

start->configure->control panel ->system->advance->environment variables

1e07c3e2b531ad269afe1295d530e87e.png

4b53dd44b654a7bcd658df15d774579e.png

Edit Path property:

e7d2800712c9d432c743ff19f4adc72c.png

Add at the beginning of the value row “C:\jdk1.3.1\jre\bin;C:\jdk1.3.1\bin;”

create or edit classpath property:

1bf226b7173068b501a11fb4ad535753.png

Add at the beginning of the value row “.;C:\jdk1.3.1\jre\lib \rt.jar;C:\jdk1.3.1\jre\lib;C:\jdk1.3.1\lib;”

choose ok.

B. configure method:

create bat file and run it in console windows before using j2sdk tools, set131.bat as example。

the set131.bat file:

set PATH=C:\jdk1.3.1\jre\bin;C:\jdk1.3.1\bin;%PATH%

set CLASSPATH=.;C:\jdk1.3.1\jre\lib\rt.jar;C:\jdk1.3.1\jre\lib;C:\jdk1.3.1\lib;%CLASSPATH%

Testing

in windows2000/xp/2003 operating systems: start->run:enter ’cmd’ command and choose Ok:

enter ‘java’ and return :

b029c8a428788501dc604c86c74ecb3a.png

enter ‘javac’ and return :

ef18e97a89f2f571782c261944f11a19.png

running the simple program in the directory “examples”

the commands as follow:

cd D:\java\lab\lab1

8f36523a5fd5ad60cfb36fdd26b39515.png\examples

javac Welcome.java              (compile the java file)

bdba9381b4dc2cc3ce720ea1eed01858.png

java Welcome                                (run the class file)

9938835c652788170c67091417de6460.png

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值