Java开发网 Java开发网
注册 | 登录 | 帮助 | 搜索 | 排行榜 | 发帖统计  

您没有登录

» Java开发网 » Java SE 综合讨论区  

按打印兼容模式打印这个话题 打印话题    把这个话题寄给朋友 寄给朋友    该主题的所有更新都将Email到你的邮箱 订阅主题
flat modethreaded modego to previous topicgo to next topicgo to back
话题锁定
该话题已被锁定 - why , 2004-09-07 22:17
如果您尚不清楚该话题被锁定的原因,请参考论坛规则以及本版公告或者联系本版版主。
作者 在 xp 下,怎么设置 jdk1.4.1的环境变量呀??
aideliwu





发贴: 18
积分: 0
于 2004-09-01 11:43 user profilesend a private message to usersend email to aideliwusearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
哎~想想我真de是 菜鸟,我学java也有段时间啦,
可是环境变量怎么也设置不好,
也不知道查le多说资料啦,
可是资料与我de实际设置总有较大差别,
我de设置如下:
在系统变量里,新建:
编为: path
c:\j2sdk1.4.1\bin;c:\j2sdk1.4.1\lib

为什么Freejava中可以编译成功,但运行不出并有error提示:
Exception in thread "main" Exit code: 1
There were errors

而在dos下却不能编译????

望高手提示,谢谢啦.


why edited on 2004-09-01 20:48

作者 Re:在 xp 下,怎么设置 jdk1.4.1de环境变量呀?? [Re:aideliwu]
aideliwu





发贴: 18
积分: 0
于 2004-09-01 13:43 user profilesend a private message to usersend email to aideliwusearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
呵呵呵呵~我解决啦~真是工夫不负有心人啊~~~
~只要努力就一定能搞定~



作者 Re:在 xp 下,怎么设置 jdk1.4.1de环境变量呀?? [Re:aideliwu]
饮者





发贴: 6
积分: 0
于 2004-09-01 13:46 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
你的环境变量设置的没错,最好加上JAVAHOME = c:\j2sdk1.4.1,以及classpath = .;c:\j2sdk1.4.1\lib

不过你的提示是你的main函数中有异常没有处理,看看代码吧,要不先写一个简单的helloWorld试试!

祝你好运! :)



作者 Re:在 xp 下,怎么设置 jdk1.4.1de环境变量呀?? [Re:aideliwu]
aideliwu





发贴: 18
积分: 0
于 2004-09-01 13:58 user profilesend a private message to usersend email to aideliwusearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
~恩恩~饮者~~谢谢你啦~~^-^~

你的提示我会用心去做de~

变量环境我已经解决啦~

只是我不明白,为什么编译成功后,运行中还会有错呢



作者 Re:在 xp 下,怎么设置 jdk1.4.1de环境变量呀?? [Re:饮者]
why

問題兒童

总版主


发贴: 4629
积分: 388
于 2004-09-01 20:51 user profilesend a private message to usersend email to whysearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
饮者 wrote:
你的环境变量设置的没错,最好加上JAVAHOME = c:\j2sdk1.4.1,以及classpath = .;c:\j2sdk1.4.1\lib

应是 JAVA_HOME
用 J2SDK 1.4.1 似乎也无须在 classpath 加上 c:\j2sdk1.4.1\lib



作者 Re:在 xp 下,怎么设置 jdk1.4.1的环境变量呀?? [Re:aideliwu]
aideliwu





发贴: 18
积分: 0
于 2004-09-01 21:39 user profilesend a private message to usersend email to aideliwusearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
呵呵呵呵~谢谢你的注意啦,饮者 wrote,你对我的问题的建议

我很开心~^-^~ 对~~我试过啦

用 J2SDK 1.4.1 无须在 classpath 加上 c:\j2sdk1.4.1\lib 的,

我还有一个比较大de问题啦~希望你能在帮帮我啊~

~我de问题写在:Re:java.io.IOException: 句柄无效???啦~

~希望你能去不厌我烦看看我de问题哈~

我真de不明白用啦InputStreamReader(System.in);

怎么会出现句柄无效呢?



作者 Re:在 xp 下,怎么设置 jdk1.4.1的环境变量呀?? [Re:aideliwu]
aideliwu





发贴: 18
积分: 0
于 2004-09-01 21:44 user profilesend a private message to usersend email to aideliwusearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
啊啊????我出错啦~~刚刚我应该感谢de是 总版主問題兒童 我误把

饮者 wrote当成作者啦~~不好意思哈~~~~感谢你们俩啊~~



作者 Re:在 xp 下,怎么设置 jdk1.4.1的环境变量呀?? [Re:aideliwu]
why

問題兒童

总版主


发贴: 4629
积分: 388
于 2004-09-02 00:51 user profilesend a private message to usersend email to whysearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
I don't know what's wrong -- it could be something about multiple versions of JDK installed.

Could you please try not to use Freejava and stick with J2SDK first?
i.e.
open Command Prompt
C:\MyJava>SET JAVA_HOME=C:\j2sdk1.4.1

C:\MyJava>SET CLASSPATH=.

C:\MyJava>SET PATH=%JAVA_HOME%\bin;%PATH%

C:\MyJava>javac NumberInput.java

C:\MyJava>java NumberInput
123
Input value is: 123
Input value changed after doubled:246


why edited on 2004-09-02 04:53

作者 Re:在 xp 下,怎么设置 jdk1.4.1的环境变量呀?? [Re:why]
aideliwu





发贴: 18
积分: 0
于 2004-09-02 22:47 user profilesend a private message to usersend email to aideliwusearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
問題兒童 Smile)))真de真de~感谢你对我问题de回复啦~
可是我按你de方法做啦还是没有结果呀~我在编译完后运行
程序停止不动啦~麻烦你帮我看看我de运行过程哈:
e:\java>set java_home=c:\j2sdk1.4.1
e:\java>set classpath=.
e:\java>set path=%java_home%bin;%path%
e:\java>javac NumberInput.java
e:\java>java NumberInput
程序就停止在这不动啦
我按下ctrl+c系统提示:
Input value is:null
Exception in thread "main"java.lang.NumberFormatException:null
at java.lang.Integer.parseInt(Integer.java:394)
at java.lang.Integer.parseInt(Interger.java:476)
at NumberInput.main(NumberInput.java:11)
哎!!!!我只能叹气啦,虽然我对环境变量有些了解啦,说实话
可我对
e:\java>set java_home=c:\j2sdk1.4.1
e:\java>set classpath=.
e:\java>set path=%java_home%bin;%path%
还是不明白它de具体意思啦,呵呵呵呵,
你能~帮帮我不呀~~~~帮我解释一下呀~~~~~
谢谢你啦^-^



费尽心思思考,不得结果不罢休,饭可以不吃,觉可以不睡,问题不能不解决
作者 Re:在 xp 下,怎么设置 jdk1.4.1的环境变量呀?? [Re:aideliwu]
why

問題兒童

总版主


发贴: 4629
积分: 388
于 2004-09-03 03:09 user profilesend a private message to usersend email to whysearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
>> e:\java>java NumberInput
>> 程序就停止在这不动啦
它等著你输入数字和按回车啦

>> e:\java>set java_home=c:\j2sdk1.4.1
一般应写 JAVA_HOME,只不过 Windows 是 case-insensitive 才可以

>> e:\java>set classpath=.
. 就是当前(current)的档案夹(folder)
JAVA 会查看这个 CLASSPATH,JRE 1.4(或更早)会自动加入 JAVA 系统的 libaries

>> e:\java>set path=%java_home%bin;%path%
%X% 就是环境变量X的值
set path=%java_home%\bin;%path%
即 c:\j2sdk1.4.1\bin; (PATH 的原值)



作者 Re:在 xp 下,怎么设置 jdk1.4.1的环境变量呀?? [Re:aideliwu]
aideliwu





发贴: 18
积分: 0
于 2004-09-03 09:09 user profilesend a private message to usersend email to aideliwusearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
~哈哈哈哈~~~~~我真de笨ou~~~~~~~~~

~嘻嘻嘻嘻~~~~啊啊啊~~~~~终于可以松口气啦~

~問題兒童 ~~~真de真de~谢谢你哈~~~~

~希望以后能得到你更多de帮助啊~~~

~~^-^~~还望你不厌我烦ou~~~



费尽心思思考,不得结果不罢休,饭可以不吃,觉可以不睡,问题不能不解决
作者 Re:在 xp 下,怎么设置 jdk1.4.1的环境变量呀?? [Re:why]
aideliwu





发贴: 18
积分: 0
于 2004-09-03 09:18 user profilesend a private message to usersend email to aideliwusearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
~恩恩~~~~why Smile)))~~~

~~我对 path 和classpath ~还是有疑问啦~~

~path,classpath~分别指什么呀~~~~

~在配置环境变量时~~可不可以用其他~~名字呢~~~



费尽心思思考,不得结果不罢休,饭可以不吃,觉可以不睡,问题不能不解决
作者 Re:在 xp 下,怎么设置 jdk1.4.1的环境变量呀?? [Re:aideliwu]
why

問題兒童

总版主


发贴: 4629
积分: 388
于 2004-09-03 09:31 user profilesend a private message to usersend email to whysearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
PATH 是执行程式时﹐作业系统所搜寻的路径──
搜寻PATH上的每个 directory,直至找到第一个要找的

CLASSPATH 是执行 JAVA 程式时,JAVA VM 所搜寻的路径──
搜寻CLASSPATH上的每个 directory,及每个 jar 档的内容

可以的话,希望不再见到那些 de li 谢谢



作者 Re:在 xp 下,怎么设置 jdk1.4.1的环境变量呀?? [Re:aideliwu]
aideliwu





发贴: 18
积分: 0
于 2004-09-03 09:40 user profilesend a private message to usersend email to aideliwusearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
呵呵呵呵,谢谢你对我的耐心哈,why,^-^

我明白啦.(聊天习惯啦,以后都不在用哈) ^-^

你可否告诉我你的oicq呀?????



费尽心思思考,不得结果不罢休,饭可以不吃,觉可以不睡,问题不能不解决
作者 Re:在 xp 下,怎么设置 jdk1.4.1的环境变量呀?? [Re:aideliwu]
barrcuda





发贴: 4
积分: 0
于 2004-09-05 21:20 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
应该加三句
PATH= c:\j2sdk1.4.1\bin;%PATH%
JAVAHOME = c:\j2sdk1.4.1
classpath = .;c:\j2sdk1.4.1\lib


barrcuda edited on 2004-09-05 21:30

作者 Re:在 xp 下,怎么设置 jdk1.4.1的环境变量呀?? [Re:barrcuda]
why

問題兒童

总版主


发贴: 4629
积分: 388
于 2004-09-05 21:23 user profilesend a private message to usersend email to whysearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
barrcuda wrote:
应该加三句
PATH= c:\j2sdk1.4.1\bin;%PATH
JAVAHOME = c:\j2sdk1.4.1
classpath = .;c:\j2sdk1.4.1\lib

PATH=c:\j2sdk1.4.1\bin;%PATH%
JAVA_HOME=c:\j2sdk1.4.1
classpath=.;c:\j2sdk1.4.1\lib


回aideliwu
敝人不用任何ICQ,MSN等等。


why edited on 2004-09-05 21:33

作者 Re:在 xp 下,怎么设置 jdk1.4.1的环境变量呀?? [Re:aideliwu]
alin_ass





发贴: 183
积分: 0
于 2004-09-07 17:35 user profilesend a private message to usersend email to alin_asssearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
小心,客户是不会去设置参数的,application还是写在bat里为好


叫我包子
作者 Re:在 xp 下,怎么设置 jdk1.4.1的环境变量呀?? [Re:alin_ass]
why

問題兒童

总版主


发贴: 4629
积分: 388
于 2004-09-07 19:18 user profilesend a private message to usersend email to whysearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
alin_ass wrote:
小心,客户是不会去设置参数的,application还是写在bat里为好

建议虽好,但跟新人说也许是对牛弹琴
新人是不会考虑客户问题的Smile


why edited on 2004-09-07 20:34

作者 Re:在 xp 下,怎么设置 jdk1.4.1的环境变量呀?? [Re:aideliwu]
jameszhang



CJSDN高级会员


发贴: 1594
积分: 111
于 2004-09-07 19:25 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
这么多人问环境变量,应该设为FAQ问题


"First they ignore u, then they laugh at u, then they fight u, then u will win

Mahatma Gandhi"

作者 Re:在 xp 下,怎么设置 jdk1.4.1的环境变量呀?? [Re:jameszhang]
why

問題兒童

总版主


发贴: 4629
积分: 388
于 2004-09-07 20:33 user profilesend a private message to usersend email to whysearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
jameszhang wrote:
这么多人问环境变量,应该设为FAQ问题


请问哪里有把这些解释得比较清楚的中文资料?



作者 Re:在 xp 下,怎么设置 jdk1.4.1的环境变量呀?? [Re:aideliwu]
jameszhang



CJSDN高级会员


发贴: 1594
积分: 111
于 2004-09-07 21:27 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
其实把论坛里的总结一下,再请各位老大补充一下,不就可以了,WHY先生也别太谦虚了,带个头吧,呵呵(还有哪个NoClassDefFoundError)

jameszhang edited on 2004-09-07 21:35

"First they ignore u, then they laugh at u, then they fight u, then u will win

Mahatma Gandhi"

作者 Re:在 xp 下,怎么设置 jdk1.4.1的环境变量呀?? [Re:jameszhang]
why

問題兒童

总版主


发贴: 4629
积分: 388
于 2004-09-07 22:11 user profilesend a private message to usersend email to whysearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
jameszhang wrote:
其实把论坛里的总结一下,再请各位老大补充一下,不就可以了,WHY先生也别太谦虚了,带个头吧,呵呵(还有哪个NoClassDefFoundError)

敝人不会做这事:
一、忙
二、敝人不明白新人的思路
三、敝人的中文还可以,但从来不看中‰文IT书,写不出来
四、忙忙忙忙忙忙忙。
请您来带个头吧。Smile
请移驾至 http://www.cjsdn.net/post/view?bid=15&id=109248


why edited on 2004-09-07 22:17


flat modethreaded modego to previous topicgo to next topicgo to back
  已读帖子
  新的帖子
  被删除的帖子
Jump to the top of page

   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923