Hi Sathvavathi,

If you use some integrated programming environment like Eclipse or NetBeans, it takes care about the location of the *javac* compiler. But if you try to executed it by hand, be sure it is in the PATH.

For e.g., under Windows, if your JDK is installed in "*C:\Program Files\myJavaSDK*", probably the *javac.exe* is in "*C:\Program Files\myJavaSDK\bin*". In this case, do create in the current directory the file "*/setenv.bat/*":

   *> notepad setenv.bat
   *

with the following content:

   *SET JAVAHOME=C:\Program Files\myJavaSDK
   SET PATH="%JAVAHOME%\bin";%PATH%*

(please notice the double quotes " - mandatory if your JAVAHOME contains any white space).

Then execute first /*setenv.bat*/:

   *> setenv*

and compile using javac only after.

The same thing applies if you are trying to compile on GNU Linux or Unix. Let's say that your *javac* compiler is in "*/usr/local/java files/bin*". In this case, do create in the current directory the file "/*sentenv.sh*/":

   *> kate setenv.sh
   *

(your currently installed editor must be different from /kate/) with the following content:

   *export JAVAHOME=/usr/local/java\ files*
   *export PATH=$JAVAHOME/bin:$PATH*

(there is no quote, but exotic characters, such as the space, must be preceded by the escape character "*\*"; other differences: the separator character in the PATH is the colon "*:*" instead of the semicolon "*;*" and the environment variables are prefixed by "*$*" instead of being surrounded by "*%*").

Then execute first /*setenv.sh*/:

   *> chmod a+x setenv.sh
    > ./setenv.sh*

and compile using javac only after.

Hope it helps
Mihai

Le 13/09/2010 09:27, Sathyavathi Sekar a écrit :


--- On *Sun, 9/12/10, Sathyavathi Sekar /<[email protected]>/* wrote:


    From: Sathyavathi Sekar <[email protected]>
    Subject:
    To: [email protected]
    Date: Sunday, September 12, 2010, 10:25 PM

    hi i am new to java programming .in the command prompt,i am
    getting error as javac file cannot be found or the or thesystem
    cannot find the path specified. what should i do?



--
To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/javaprogrammingwithpassion?hl=en

--
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/javaprogrammingwithpassion?hl=en

Reply via email to