I just got the book "Learn Java in 21 Days" from the library. I created a small program using Notepad and have not been successful in compiling it. I have win95. On the Taskbar I click START->RUN, then I type in: C:\jdk1.1.8\bin\javac C:\HelloWorld.java, and nothing happens. A HelloWorld.class file isn't created. I'm obviously doing something wrong. Can someone help me? Thanks in advance. Mike B.
Thanks Paul for responding. I opened up the DOS prompt and typed in javac HelloWorld.java and got the bad command or filename message. What do you mean when you say <If you have your path pointing to your JDK>? As far as using the JDK1.1.8- I just downloaded it from Sun's webpage. I must have missed the version you're referring to. Thanks again, Mike B.
posted 20 years ago
Part of the previous post didn't print. I was asking, What do you mean when you say,"As long as your path is pointing toward JDK." Thanks, MikeB.
I suggest you scrap 1.1.8 and go get 1.2.2 from sun. If you are going to learn Java, it would be best if you learned the most recent version. They are starting a renaming thing, so you might have to look for Java 2 SDK 1.2.2. Once you have installed it, you will need to change your path to access the binaries in Java 2. PATH=(lots of other stuff);C:\JDK1.2.2\bin Now you will be able to compile from the command line with just "javac MySource.java"
Once you have installed it, you will need to change your path to access the binaries in Java 2. PATH=(lots of other stuff);C:\JDK1.2.2\bin Just in case that still worries you, the simplest way to update your PATH is to open C:\AUTOEXEC.BAT in notepad, and add a line exactly as follows: PATH=%PATH%;C:\JDK1.2.2\bin on a line of its own at the end of the file. and then reboot your PC. Let us know how you get on.
Thanks everyone. I realized I better ask less questions and do more reading since I'm such a beginner that I didn't even understand "path". Luckily, between your posts and the great tutorial available on-line from Sun I'm now compiling. In the book "Learn Java in 21 Days" they say upfront that it's written for people with object-oriented programming experience- which I don't have. The tutorial has 8 pages devoted to getting one's first Java app to compile. Thanks again, Mike B.