Running Java Problem

I am new to Java. Here is my problem I get the error message when I try to run javac. I have jdk1.6.0_06 loctaed in my program files/Java. I checked and I have javac located in the bin of the jdk1.60_06 file. I tried changing the path to c:\program files\java\jdk1.6.0_0\bin but still get the error. Is this the wrong path?
bdiddy05Asked:
Who is Participating?
 
objectsConnect With a Mentor Commented:
should be:

"c:\program files\java\jdk1.6.0_06\bin\";C:\GMX
0
 
CEHJCommented:
Please post the result of

echo %PATH%
0
 
bdiddy05Author Commented:
Where will that be found?
0
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

 
souseranCommented:
Go to Start | Run. Type CMD. Press Enter. Type the command in the new screen. Press Enter after you type it.
0
 
souseranCommented:
Also, see this Java article:

Setting the class path

http://java.sun.com/j2se/1.5.0/docs/tooldocs/windows/classpath.html

Try following the steps there to see if that fixes the problem for you.
0
 
bdiddy05Author Commented:
I typed echo %PATH% into the command prompt and the following was displayed:
c:\program files\java\jdk1.6.0_0\bin;C:\GMX
0
 
souseranCommented:
What were the results of trying the steps outlined in the linked article?
0
 
CEHJCommented:
Then you should be able to execute javac at the command line too
0
 
bdiddy05Author Commented:
I didn't think I had to change the class path.
My class path is currently set to: .;C:\Program Files\Java\jre1.5.0_02\lib\ext\QTJava.zip.
0
 
bdiddy05Author Commented:
This is what I tried: "C:\Documents and Settings\Owner>javac " and then enter. I am still getting the same error message. Am I typing it wrong?
0
 
CEHJCommented:
>>This is what I tried: "C:\Documents and Settings\Owner>javac

*In the same command window* can you do

echo %PATH%

?
0
 
bdiddy05Author Commented:
Yes,
I even closed it and opened a new window. I typed the echo %PATH% (which displayed the same message above) and then javac on the next line.
Still got the same error.
0
 
CEHJCommented:
Does

c:\program files\java\jdk1.6.0_0\bin\javac.exe

exist?
0
 
souseranCommented:
> My class path is currently set to: .;C:\Program Files\Java\jre1.5.0_02\lib\ext\QTJava.zip.

Your current class path is set to use the Java Runtime Edition 1.5.0 => jre1.5.0_02

Yet you indicate you are using jdk1.6.0_06

At the command prompt, what is the result if you type SET and press Enter?
0
 
CEHJCommented:
The issue is nothing to do with the classpath
0
 
krakatoaCommented:
In a command prompt window, type this exact command and then press enter. Post the results back here:

dir c:\javac.exe /s


0
 
objectsCommented:
Path should be:

c:\program files\java\jdk1.6.0_06\bin

try also running it directly

"c:\program files\java\jdk1.6.0_06\bin\javac"
0
 
sprjp2Commented:
Are you sure that the directory is
c:\program files\java\jdk1.6.0_0\bin
and not
c:\program files\java\jdk1.6.0_06\bin ?
0
 
bdiddy05Author Commented:
Krak,
after inputting dir c:\javac.exe/s the following was shown:
Volume in drive C has no label
Volume Serial NUmber is d006-e60e
0
 
bdiddy05Author Commented:
I got ahead of myself. Also after inputting the above command this also showed up:
Directory of c:\Program Files\Java\jsk1.6.0\bin
3/25/2008 2:17 AM                     25,600 javac.exe
1 file(s)                                       25,600bytes
0 dir(s)                                      49,961,308,160 bytes free
0
 
objectsCommented:
did u try running it directly (by entering the full path) as I suggested above?

0
 
bdiddy05Author Commented:
yes I tried running the full path and this is what came up:
c:\Program  is not recgonized as an internal or external command opertable program or batch file
0
 
objectsCommented:
you'll need to quote it as it contains spaces.
(also quote it in your path)

0
 
bdiddy05Author Commented:
I included the quotes and a whole bunch of stuff came up;
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Documents and Settings\Owner>"c:\program files\java\jdk1.6.0_06\bin\javac"
Usage: javac <options> <source files>
where possible options include:
  -g                         Generate all debugging info
  -g:none                    Generate no debugging info
  -g:{lines,vars,source}     Generate only some debugging info
  -nowarn                    Generate no warnings
  -verbose                   Output messages about what the compiler is doing
  -deprecation               Output source locations where deprecated APIs are u
sed
  -classpath <path>          Specify where to find user class files and annotati
on processors
  -cp <path>                 Specify where to find user class files and annotati
on processors
  -sourcepath <path>         Specify where to find input source files
  -bootclasspath <path>      Override location of bootstrap class files
  -extdirs <dirs>            Override location of installed extensions
  -endorseddirs <dirs>       Override location of endorsed standards path
  -proc:{none,only}          Control whether annotation processing and/or compil
ation is done.
  -processor <class1>[,<class2>,<class3>...]Names of the annotation processors t
o run; bypasses default discovery process
  -processorpath <path>      Specify where to find annotation processors
  -d <directory>             Specify where to place generated class files
  -s <directory>             Specify where to place generated source files
  -implicit:{none,class}     Specify whether or not to generate class files for
implicitly referenced files
  -encoding <encoding>       Specify character encoding used by source files
  -source <release>          Provide source compatibility with specified release

  -target <release>          Generate class files for specific VM version
  -version                   Version information
  -help                      Print a synopsis of standard options
  -Akey[=value]              Options to pass to annotation processors
  -X                         Print a synopsis of nonstandard options
  -J<flag>                   Pass <flag> directly to the runtime system


0
 
objectsCommented:
ok, that worked.
you should just be able to correct your path and it should work ok,

0
 
bdiddy05Author Commented:
I changed the path to exactly that. When I go into a new command prompt, I  just type in javac, correct?
I did this and still get the same error.
0
 
objectsCommented:
did u quote it?

0
 
bdiddy05Author Commented:
yes
0
 
objectsCommented:
what is your path now?

echo $PATH

0
 
objectsCommented:
sorry, echo %PATH%

0
 
bdiddy05Author Commented:
You meant echo %PATH% correct?
"c:\program files\java\jdk1.6.0_06\bin\javac";C:\GMX
0
 
objectsCommented:
how ru setting the PATH?

0
 
bdiddy05Author Commented:
Ok I changed the path like above and I get the same message:
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Documents and Settings\Owner>javac
Usage: javac <options> <source files>
where possible options include:
  -g                         Generate all debugging info
  -g:none                    Generate no debugging info
  -g:{lines,vars,source}     Generate only some debugging info
  -nowarn                    Generate no warnings
  -verbose                   Output messages about what the compiler is doing
  -deprecation               Output source locations where deprecated APIs are u
sed
  -classpath <path>          Specify where to find user class files and annotati
on processors
  -cp <path>                 Specify where to find user class files and annotati
on processors
  -sourcepath <path>         Specify where to find input source files
  -bootclasspath <path>      Override location of bootstrap class files
  -extdirs <dirs>            Override location of installed extensions
  -endorseddirs <dirs>       Override location of endorsed standards path
  -proc:{none,only}          Control whether annotation processing and/or compil
ation is done.
  -processor <class1>[,<class2>,<class3>...]Names of the annotation processors t
o run; bypasses default discovery process
  -processorpath <path>      Specify where to find annotation processors
  -d <directory>             Specify where to place generated class files
  -s <directory>             Specify where to place generated source files
  -implicit:{none,class}     Specify whether or not to generate class files for
implicitly referenced files
  -encoding <encoding>       Specify character encoding used by source files
  -source <release>          Provide source compatibility with specified release

  -target <release>          Generate class files for specific VM version
  -version                   Version information
  -help                      Print a synopsis of standard options
  -Akey[=value]              Options to pass to annotation processors
  -X                         Print a synopsis of nonstandard options
  -J<flag>                   Pass <flag> directly to the runtime system

Is this correct?
0
 
objectsCommented:
thats correct, good work :)
0
 
bdiddy05Author Commented:
Wow that was it, do I feel dumb. Two days of going over it and it was just one word I had to change in the PATH.

Thank you so much for the help, you rock.
0
 
bdiddy05Author Commented:
Thank you so much, you rock.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.