can anyone say how to use java in windows 7
I installed it but its not working.
i am unable to compile a java program.
please help me in solving this problem.


i am getting this message in command problem when i use javac

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

please help me

Recommended Answers

All 12 Replies

That's not a Java problem, it's a problem with your understanding (or lack thereof) of your operating system.
You need to add the location of the java.exe and javac.exe to your system path environment variable (they're in the same directory).

can anyone say how to use java in windows 7
I installed it but its not working.
i am unable to compile a java program.
please help me in solving this problem.


i am getting this message in command problem when i use javac

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

please help me

You need to set the path of the java in the environmental variables inorder to compile
and run the java programs..


Go to the folder where java installed and copy the path of the bin folder

for ex. In my system , java is installed C drive.

C:\Program Files\Java\jdk1.6.0\bin;

set the bin folder path to the environmental variables path

Now find the rt.jar file in the jre\lib folder .

C:\Program Files\Java\jre1.6.0\lib\rt.jar;.;

copy the path of rt.jar file and set the class path in environmental variables

now you can compile and run the java programs..

enjoy java programming

"copy the path of rt.jar file and set the class path in environmental variables"

WRONG. Not needed, not recommended, don't do this.

sorry sir
i have set the path and i am trying to use it
even though i am not getting it
please help me

and now again i installed java 6.0
i am not finding javac in it
i am having javap
java
javaw
javaws
and many more but not javac
in this path
"C:\Program Files\Java\jre6\bin"
i have my java in c drive

and sir forgot to ask
what's the use of those javaw
javaws...... and many more like these
it would be useful to me if i am given any few words about them
thanks in advance

"copy the path of rt.jar file and set the class path in environmental variables"

WRONG. Not needed, not recommended, don't do this.

Setting the classpath will make the jdk to know where your class files are.


The CLASSPATH variable is one way to tell applications, including the JDK tools, where to look for user classes. (Classes that are part of the JRE, JDK platform, and extensions should be defined through other means, such as the bootstrap class path or the extensions directory.)


The advantage of classpath is you can create your own package and can use as part of
those packages that available in java ..


*****************

Setting the classpath doesn't mean that it is wrong..

It looks like you have installed the Java Runtime Environment (JRE) which allows you the run Java programs, but not the Java Development Kit (JDK) that allows you to create them. If you haven't already done so, download and install the latest JDK.

ps java.exe runs java programs in a DOS-type window
javaw.exe is the same, but it doesn't show the DOS window. This is the one you normally use to run Java GUIs.

Quick notes how to install Java can also found in this post

You did not set a class path, so you can set classpath as per following instruction
* First go to command prompt and write cd c: then
Your drive name:\folder name >set path=%path%;C:\Program Files\Java\jdk1.6.0_03\bin;

Your drive name:\folder name>set path=%path%;C:\Program Files\Java\jdk1.6.0_03\lib;

Your drive name:\folder name>set classpath=.

Just to get this back on track...
the OP's problem is "'javac' is not recognized as an internal or external command,
operable program or batch file."

This is unlikely to be a classpath problem, but even so the installer will set the classpath, there's no need to modify it for a standard installation.

Setting the classpath doesn't mean that it is wrong..

Setting the classpath at system level is wrong. It invites trouble with relying on libraries you don't realise you have in your classpath, including version conflicts.
Adding rt.jar to the classpath is wrong as well. It's not only completely unnecessary, it's harmful especially if you have several JDKs installed.

IOW, you're telling him to do something that's just plain wrong for 2 reasons.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.