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

您没有登录

» Java开发网 » Java SE 综合讨论区 » 安装/配置/编译/环境  

按打印兼容模式打印这个话题 打印话题    把这个话题寄给朋友 寄给朋友    该主题的所有更新都将Email到你的邮箱 订阅主题
flat modethreaded modego to previous topicgo to next topicgo to back
作者 j2sdk老问题,classpath等,认真配置后仍然存在问题!
haiwanxue





发贴: 1
积分: 0
于 2004-12-12 23:17 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
各位大吓原谅我又问老掉牙的问题,但我确实查看了本站所有相关文章,利用了所有办法还是行不同,很想学习java,但开始就这样,帮忙啊,谢谢!

我安装的是j2sdk1.4.1,安装在c盘,然后把目录改名为j2sdk。
然后配置
java_home c:\j2sdk
path c:\j2sdk\bin
classpath .;C:\j2sdk\lib\dt.jar;C:\j2sdk\lib\tools.jar

然后到d:\java下,javac test.java,其中test.java在d盘java目录下
test.java的内容是:
class test
{
  public static void main(string [] args)
  {
    system.out.println("My first java program");
  }
}

结果还是错误,提示为:
D:\java>javac test.java
test.java:3: cannot resolve symbol
symbol : class string
location: class test
public static void main(string [] args)
^
test.java:5: package system does not exist
system.out.println("My first java program");
^
2 errors

能不能给我提示一下可能的问题所在,万分感谢!



作者 Re:j2sdk老问题,classpath等,认真配置后仍然存在问题! [Re:haiwanxue]
bluepure

pureblue



发贴: 509
积分: 85
于 2004-12-13 09:13 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
java 程序错了:

public class test
{
public static void main(String[] args)
{
System .out.println("My first java program");
}
}

严格注意大小写。


littledeer1974 edited on 2004-12-13 09:18

作者 Re:j2sdk老问题,classpath等,认真配置后仍然存在问题! [Re:bluepure]
littledeer1974

Garbage Collector

CJSDN高级会员


发贴: 1517
积分: 122
于 2004-12-13 09:26 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
class 前的public没有也可以吧

class test
{
public static void main(String[] args)
{
System .out.println("My first java program");
}
}

我的这个程序也运行了Smile



Surround yourself with people who are open to change

作者 Re:j2sdk老问题,classpath等,认真配置后仍然存在问题! [Re:haiwanxue]
bluepure

pureblue



发贴: 509
积分: 85
于 2004-12-13 09:40 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
哦,是我搞错了,是不允许有多个public,呵呵


作者 Re:j2sdk老问题,classpath等,认真配置后仍然存在问题! [Re:haiwanxue]
sxjy





发贴: 17
积分: 0
于 2004-12-14 07:58 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
是这样的,把string中的第一字母s改为大写的S,把system中的第一个字母s改为大写的S。


作者 Re:j2sdk老问题,classpath等,认真配置后仍然存在问题! [Re:haiwanxue]
tanytan





发贴: 22
积分: 0
于 2004-12-20 15:33 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
我记得好象哪一本java书上说java的关键字都是小写的吧,为什么要在这里要大写呢?


作者 Re:j2sdk老问题,classpath等,认真配置后仍然存在问题! [Re:haiwanxue]
lolme





发贴: 20
积分: 0
于 2004-12-20 16:30 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
应该严格按语法来写,你查一下API文档就是了


坚信态度决定一切
作者 Re:j2sdk老问题,classpath等,认真配置后仍然存在问题! [Re:haiwanxue]
johnyq





发贴: 8
积分: 0
于 2004-12-24 15:41 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
这是我们这些新手学JAVA的毛病...
练多了就好了....



作者 Re:j2sdk老问题,classpath等,认真配置后仍然存在问题! [Re:haiwanxue]
dennisjl





发贴: 53
积分: 1
于 2004-12-24 19:17 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
System不是关键字, 它是类, 类的默认习惯是开头大写的。


作者 Re:j2sdk老问题,classpath等,认真配置后仍然存在问题! [Re:haiwanxue]
dy18





发贴: 199
积分: 74
于 2004-12-24 20:38 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
class test
{
  static public void main(String[] args)
  {
    System .out.println("My first java program");
  }
}

我這個也行



作者 Re:j2sdk老问题,classpath等,认真配置后仍然存在问题! [Re:haiwanxue]
卡克洛奇





发贴: 16
积分: 0
于 2004-12-26 12:38 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
Class第一个字符需要大写,method和field不应该首字母大写...


作者 Re:j2sdk老问题,classpath等,认真配置后仍然存在问题! [Re:haiwanxue]
jianghuren





发贴: 2
积分: 0
于 2004-12-27 10:58 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
System String 都是类名



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