solution to java problem

4 views
Skip to first unread message

VIKAS RUHELA

unread,
Jan 18, 2008, 1:55:43 PM1/18/08
to UIET Sun Open Source User Group
Hi aman the problem is with u is because of the environment variable
which is not defined automatically.
you have to set the path for your java compiler.
for that open the system properties and then the advance tab in it.
here you get a button of the environment variable....
open this and then u get the option for user variable and system
variable......
open the new user variable ...
and enter PATH in variable name and path to your jdk/bin e.g.
C:\Program Files\Java\jdk1.6.0_03\bin
and then open the new system variable and enter CLASS PATH as
variable name and path to the java/lib
e.g.:-
C:\Program Files\Java\jdk1.6.0_03\lib.

Rahul Mathur

unread,
Jan 19, 2008, 3:48:46 AM1/19/08
to UIET Sun Open Source User Group
Hi aman. Vikas has rightly pointed out to the problem. I will like to
further add why this problem occurs.

The error messages which you saw occurs commonly on Microsoft Windows
Systems. It must have been something like this:

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

This message means that Windows cannot find the compiler (javac).

Here's one way to tell Windows where to find javac. At the prompt type
the following command and press Enter:

C:> "\Program Files\Java\jdk1.6.0_<version>\bin\javac
HelloWorldApp.java

If you choose this option, you'll have to precede your javac and java
commands with C:> "\Program Files\Java\jdk1.6.0_<version>\bin\ each
time you compile or run a program. To avoid this extra typing and to
be able to conveniently run the JDK executables (javac.exe, java.exe,
javadoc.exe, etc.) from any directory without having to type the full
path of the command, you should update the PATH variable.

To set the PATH permanently, add the full path of the
jdk1.6.0_<version>\bin directory to the PATH variable. Typically this
full path looks something like C:\Program Files\Java\jdk1.6.0_<version>
\bin. Set the PATH as follows on Microsoft Windows:

1. Click Start > Control Panel > System on Windows XP or Start
> Settings > Control Panel > System on Windows 2000.
2. Click Advanced > Environment Variables.
3. Add the location of bin folder of JDK installation for PATH
in User Variables and System Variables. A typical value for PATH is:

C:\Program Files\Java\jdk1.6.0_<version>\bin

The PATH environment variable is a series of directories separated by
semi-colons (;) and is not case sensitive. Microsoft Windows looks for
programs in the PATH directories in order, from left to right. You
should only have one bin directory for a JDK in the path at a time.
Those following the first instance are ignored. If one is already
present, update it to jdk1.6.0_<version>\bin. If you are not sure
where to add the path, add it to the right end of the PATH in the User
Variables.
The new path takes effect in each new command window you open after
setting the PATH variable.

Hope this will run your first java program. Do write back to the group
whether your problem is solved or not.

AMAN AHUJA

unread,
Jan 21, 2008, 12:07:19 PM1/21/08
to uietsunu...@googlegroups.com
Hello
It solved the problem, though some tactics have to be employed while compiling the simplest of the programs. It worked well in the end, thankyou.

Reply all
Reply to author
Forward
0 new messages