×

Loading...
Ad by
Ad by

JAVA compiling error! I can't find any solution for that. Help me please.Thank you

Hi,Friends.I am facing a problems about compiling java files.
I just start to learn Java.I installed J2SDK1.4.0_01,and then accroding to
th the tutorial of SUN web site, I tried HelloWorldApp.java. But when I compiled it,
a message says" cannot read: HelloWorldApp.java.
Seveal points need mentioned:
1. no mistake with the java file name. I know it's case sensitive.
2. In DOS prompt, I was in the directory of the java file.
3. I didn't edit path in Autoexec.bat, Because I am not sure how to do it.
Instead, I input full path to implement compiling. C:\j2sdk1.4.0_01\bin\javac filename.
When I only execute C:\j2sdk1.4.0_01\bin\javac, some help infomation shows up.
4.the java file exsits with java appendix.I saw it in dos prompt.
5. the java file is copied from Sun's tutorials, should be Ok.
I spent serveral hours on this stupid problem, but cannot fix it, So please help me.
Don't be too abstract when tell me how to do it.I am just begainning. Thanks a lot.
Report

Replies, comments and Discussions:

  • 工作学习 / IT技术讨论 / JAVA compiling error! I can't find any solution for that. Help me please.Thank you
    Hi,Friends.I am facing a problems about compiling java files.
    I just start to learn Java.I installed J2SDK1.4.0_01,and then accroding to
    th the tutorial of SUN web site, I tried HelloWorldApp.java. But when I compiled it,
    a message says" cannot read: HelloWorldApp.java.
    Seveal points need mentioned:
    1. no mistake with the java file name. I know it's case sensitive.
    2. In DOS prompt, I was in the directory of the java file.
    3. I didn't edit path in Autoexec.bat, Because I am not sure how to do it.
    Instead, I input full path to implement compiling. C:\j2sdk1.4.0_01\bin\javac filename.
    When I only execute C:\j2sdk1.4.0_01\bin\javac, some help infomation shows up.
    4.the java file exsits with java appendix.I saw it in dos prompt.
    5. the java file is copied from Sun's tutorials, should be Ok.
    I spent serveral hours on this stupid problem, but cannot fix it, So please help me.
    Don't be too abstract when tell me how to do it.I am just begainning. Thanks a lot.
    • Give the whole DOS command line of how you tried to compile the thing.
      • C:\j2sdk1.4.0_01\bin\javac HelloWorldApp.java //* My JSDK is in C:\
        1. I use Notepad to copy the HelloWorldApp code from Sun.
        2. I save it with "HelloWorldApp.java" (quote including) in c:\java
        3.launch Dos PROMPT.
        4. switch to c:\java
        5. C:\java\dir //* HelloWorldApp.java is there.
        6.switch to c:\
        7.C:\j2sdk1.4.0_01\bin\javac HelloWorldApp.java
        8.response: "error,cannot read: HelloWorldApp.java "
        Thank you so much, I am waiting for your advice.
        • Repeat everything you have done except Step 6.
          • I tried twice, all return "Bad Command or file name"
            • in No. 7.. change to javac.exe
            • and still ignore No.6
              • doesn't work.
            • 拿你真没择
        • 学多久了?
          • 1 DAY.
            • 多看半小时书比在这里问3小时惯用
        • Go download a JBuilder personal edition for free!!!!!
          • I am trying http://www.borland.com to download Jbuilber, but some security alert pops out, say it's a inseure site, is is safe to download? OR, u know a better place to go? Thanks
            • 先睡觉明天全好了
              • Hi,man. you look like have nothing to do except saying some FENG LIANG HUA. I think people here are usually warmheated.Of course, I NEED read book myself, but I also can get some good clues here.
                • 喂,我不是说风凉话,只是觉得你并没有仔细按照别人的指点去做。IT需要一些灵性的。路太长了。
            • 可以考虑下个简单点的,我推荐kawa,不过已经停止开发了,可能不好找。听说Jpad Pro也不错,url是下载Jpad Pro的链接。
        • 请确认你的文件名是HelloWorldApp.java而不是HelloWorldApp.java.txt!!!!!!
          • WINDOWS隐藏文件扩展名的功能害人啊!!!
          • i am sure it **.java. I saw it in DOS prompt. Thanks
    • set up environment variables path=c:\j2sdk1.4.0_01\bin, classpath=c:\j2sdk1.4.0_01\jre\lib\rt.jar
      • Is that copy:path=c:\j2sdk1.4.0_01\bin, classpath=c:\j2sdk1.4.0_01\jre\lib\rt.jar to Sysedit in Autoexec.bat? I tried but doesn't work.BTW, need reboot or not after modified sysedit? Thanks
        • 什么操作系统啊! 32,95,98,NT,2000,xp,linux,unix啊
        • no, not in autoexec.bat. it depends on different os. in winxp, control panel-system-advanced-environment variables. make sure u create classpath
    • 还不尽热点啊
    • 能不能用中文啊
    • 查找IME在你的机器中然后安装,你可以输汉字了
    • 真睡了?
    • 是拨号上网?
    • make sure that the class name is the same as the file name. Capital sensitive.