• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Just starting out-have question

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Trailboss
Posts: 23214
IntelliJ IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Pull up a DOS window.
If you have your path pointing to your JDK, you should be able to just type
javac HelloWorld.java

Why are you using the JDK 1.1.8 and not 1.2.2?
 
MikeB
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
MikeB
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
paul wheaton
Trailboss
Posts: 23214
IntelliJ IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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"
 
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
MikeB
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic