# Java Program Execution



## Caliraj (Mar 22, 2006)

Hi, 
There are folders like JDK and JDBC & JLB in the follwing path :
C:\oracle\ora92

Now, in the environment variables section, the variable PATH has been set the following value:
C:\oracle\ora92\bin;C:\Program Files\Oracle\jre\1.3.1\bin;C:\Program Files\Oracle\jre\1.1.8\bin;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\ System32\Wbem;C:\Program Files\ATI Technologies\ATI Control Panel;C:\Program Files\Common Files\MDL Shared\isis;C:\Program Files\Common Files\IDBS Shared;C:\Program Files\IDBS\SARgen

Now howerever I execute the javac command, I get the following error:
'javac' is not recognized as an internal or external command,
operable program or batch file.
Could anyone help?


----------



## Chicon (Jul 29, 2004)

Hi Caliraj,

You must create a new environment variable called *JAVA_HOME* with the path of your JDK.
Example : C:\Program Files\Java\jdk1.5.0_09\bin


----------



## Caliraj (Mar 22, 2006)

Hi,
Now there seems to be 2 java folders :
1) C:\oracle\ora92 : In this location, there are folders like JDBC, JDK,JLIb
2) C:\Program Files\Java : In this location, there are folders liek j2re1.4.1, j2re1.4.2_08 and jre1.5.0_03

Now, to strat working on java programs, do you need JRE or JDK.Im thoroughly confused here 
In the COntrol Panel, int the Add/Remove programs, I find the following:
a)J2SE Runtime environment5.0 Update 3
b)Java Runtime Environment 1.3
c)Java Runtime Environment 1.4.1
d)Java Runtime Environment 1.4.2_08
e)Java_for_MUPET
f)JRE142_For_MUPET
g)JRE150_For_MUPET
Now if I plan to strat rfom start, which of tehse must I uninstall?Could you help me out of these issues ?
Thanks.


----------



## Chicon (Jul 29, 2004)

There's already a Java runtime under the folder *C:\Program Files\Oracle\jre\1.3.1*
*javac.exe* is stored in the *bin* folder of a JDK whatever version it is.
Try to see if there's such folder under *C:\oracle\oracle92\JDK* if you mean to compile your application using the JRE version 1.3.1.


----------



## Caliraj (Mar 22, 2006)

Hi,
As you said, there is a java.exe & javac.exe in the bin folder of JDK present in the following link : C:\oracle\ora92\jdk\bin
Now,the JRE1.3.1 is in the C:\Program Files\Oracle path.
I have saved my hello.java program in the following link : C:\nrk.Still wherever I run the "javac hello.java" command, I get the following error:
'javac' is not recognized as an internal or external command,
operable program or batch file.
I thought I can start everything from scratch.So is it ok if I remove all the existing jre,java folders?
As in my previous mail, in the ADD/REMOVE progrmas list, I also have programs like
a)J2SE Runtime environment5.0 Update 3
b)Java Runtime Environment 1.3
c)f)JRE142_For_MUPET etc.........
Shall I remove all tehse and start downloading a new JDK?


----------



## Chicon (Jul 29, 2004)

I also have many different versions of the JRE/JDK because I need them for my job.
I would suggest you to properly uninstall all the Java stuff and to download the last version of the JSE from here : JDK 5.0 Update 9

The package will install both JDK and JRE version 1.5.0_09 on your computer.

Create 2 environment variables :
JAVA_HOME for the JDK C:\Program Files\Java\jdk1.5.0_09
JAVA_RUN for the JRE C:\Program Files\Java\jre1.5.0_09

Add to the variable PATH : %JAVA_HOME%\bin;%JAVA_RUN%\bin


----------



## Caliraj (Mar 22, 2006)

Hi,
As per your mail, I have installed the JDK 5.0 Update 9 (online version for windows).I have placed it in C:Hence I have set SYstem variables as follows:
JAVA_HOME : C:\jdk1.5.0_09
JAVA_RUN : C:\jre1.5.0_09
I also added to the PATH variable, %JAVA_HOME%\bin;%JAVA_RUN%\bin
I then restarted the system.My sample java program, output.java is in C:\nrk
Now, when I opened a command prompt,(it was in C:\Documents & Settings), I cd to C:\ where I executed "javac output.java" for which I got an error:
'javac' is not recognized as an internal or external command,
operable program or batch file.
Could you let me know where I have gone wrong ?


----------

