The Artima Developer Community
Sponsored Link

Java Answers Forum
Can somebody help me please ??

2 replies on 1 page. Most recent reply: Dec 27, 2002 9:05 PM by Simon

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 2 replies on 1 page
Simon

Posts: 2
Nickname: simon7474
Registered: Dec, 2002

Can somebody help me please ?? Posted: Dec 27, 2002 6:57 PM
Reply to this message Reply
Advertisement
Hi... :)

I'm sorry if this request seems rather basic, but i am trying to teach myself Java from a book called "Java made simple" by author P.K.McBride.

I followed all the instructions to the letter, I downloaded and installed SDK from java.sun.com, and then i created the necessary .BAT file in notepad and set the PATH to my working folder. Then I saved the file into the Windows folder as GOJAVA.BAT
This allows me to goto my working folder from the DOS prompt by just typing gojava
SO far so good !!
The FIRST task asks you to compile an example using the command "javac", again i followed all the steps.
It tells you to type at the DOS propmt "javac Hello.java", in order to compile the text i wrote in notepad and saved in my working folder as "Hello.java"

I get an error message saying....

'javac' is not recognised as an internal or external command, operable program or batch file.

Can anyone help me please..??

Note..
The pictures in the book show Windows 98 as the OS
I am using XP pro
not sure if that makes a difference..??

Thanks in advance

Simon


Kishori Sharan

Posts: 211
Nickname: kishori
Registered: Feb, 2002

Re: Can somebody help me please ?? Posted: Dec 27, 2002 7:19 PM
Reply to this message Reply
You need to include the bin folder under SDK main folder in your PATH environment variable. I am assuming that you always execute your gojava.bat before compiling your program. Suppose you have installed your SDK in c:\java2 folder. Then javac.exe resides as c:\java2\bin\javac.exe. Now you need to include c:\java2\bin in your PATH. in gojava.bat file you can include a line as:
SET PATH=%PATH%;c:\java2\bin
.....Here goes rest of your code.....

Now when you type
javac your_file_name.java
then you won't get any error message as you were getting.

Alternatively, you can type the full path of javac to compile your java classes as;
c:\java2\bin\javac your_file_name.java

You may also want to set this PATH permanently for yourself. For windows 95/98 you set it in autoexec.bat file. For NT/2000/XP you set it as
Start -> Control Panel -> System -> Advanced (Tab) -> Environment Variables (Button)

Thanks
Kishori

Simon

Posts: 2
Nickname: simon7474
Registered: Dec, 2002

Re: Can somebody help me please ?? Posted: Dec 27, 2002 9:05 PM
Reply to this message Reply
Thanks Kishori :)

I have it working now !!

The problem was i hadn't given the correct PATH to javac.exe in the batch file i created.

I'm sure i'll have more questions in the future as i learn :)

again many thanks !!

Simon

Flat View: This topic has 2 replies on 1 page
Topic: RGB  - Color Question: Please Help Previous Topic   Next Topic Topic: installiation problem i guess !?!? need help

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use