Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Installation Question from the Greenest Greenhorn  RSS feed

 
Jeffrey Gawel
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
So here's my problem: I am trying to learn Java using the Sierra/Bates book, and I tripped on the first hurdle (actually, didn't get to the hurdle). I've downloaded and installed JDK 1.5.0_12 and JRE 1.5.0_12, and I tried working on a very simple first example. I created my .java file in NotePad, but at this point, I cannot create the class file, because I cannot access the compiler. If I click on any Java file in /bin, the command prompt flickers and goes away instantly. I cannot find any Java environment, per se.

Somehow, the other day, I did manage to create the .class file - don't ask how - but when I tried to run it, the same thing happened, the command prompt flickered and disappeared. So, my nice little too simply Java app never appeared (certainly nothing appeared that looked like the example in the book)!

So, now I;m totally stuck and discouraged. What to do? Did I screw up the install? In the book (pg. xxviii) it mentions to "add an entry to your PATH environment variable that points to the bin directory...yadda yadda yadda...that directory is the one that you need a PATH to, so that when you type: % javac at the command-line, your terminal will know how to find the javac compiler.

I don't even know what the PATH is, so I obviously didn't do this. Not sure if that has anything to do with it? I did type % javac in the command prompt window, and nothing happened.

So.....what to do now?
Thanks!
Jeff
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch!

First, please check your private messages by clicking on "My Profile." Thanks!

Setting the PATH variable tells your system where to find the Java executables, and this allows you to compile and run from any directory. To set the PATH variable, see Sun's 5.0 installation instructions for Windows. Step 5 describes setting the PATH variable. (Let us know if you're running a different operating system.)

Once your path is set, see this Hello World Tutorial (for Windows), which will take you though the steps of writing, compiling, and running a simple Java program.

Let us know how it goes.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!