wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes Trying to install JAVA JDK Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Trying to install JAVA JDK" Watch "Trying to install JAVA JDK" New topic
Author

Trying to install JAVA JDK

Brenda Stevens
Greenhorn

Joined: Feb 11, 2011
Posts: 19
HI

I HAVE DOWNLOADED THE JAVA JDK 1.6, BUT I AM HAVING TROUBLE WITH THE ENVIROMENT VARIABLES. I HAVE TYPED IN JAVAC INTO THE COMMAND PROMPT JUST TO MAKE SURE THAT IT IS INDEED JAVA 1.6 WHICH IT IT.

AT THIS CURRENT TIME THE USER VARIABLES FOR MY COMPUTER DOESNT HAVE ANY. BUT THE USER VARIABLES FOR THE SYSTEM HAVE: HOME: C:\Program Files\java\jdk1.6.0_23 AND THE PATH WHICH IS IN SYSTEM VARIABLES IS : C:\Program Files\Java\jdk1.6.0_23\bin;

I REALLY DO NEEED HELP WITH THIS AS I CAN CHANGE DIRECTORY TO THE FOLDER WHERE THE JAVA FILES ARE, BUT I AM UNABLE TO COMPILE ANY OF THE FILES. I NEED URGENT HELP AS I AM TRYING TO COMPLETE A WEBSERVER ASSIGNMENT WHICH IS DUE AND THIS WOULD HELP IF I AM ABLE TO DO THIS AT HOME AND NOT JUST AT IN THE LABS AT MY UNIVERSITY. ALL HELP WOULD BE APPRECIATED THANK YOU
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60774
    
  65

Yo, dude! All that uppercase makes things hard to read and really hurts my eyes. I'd suggest that if you really want people to read your posts that you make them easier to read. Check out this FAQ: KeepItDown.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Brenda Stevens
Greenhorn

Joined: Feb 11, 2011
Posts: 19
lol ok thanks for that as i am new to this forum sorry about the upper case. i have now changed to lower case and hope this helps
marc weber
Sheriff

Joined: Aug 31, 2004
Posts: 11343

Welcome to the Ranch!

If...

javac -version

...is confirming that you have 1.6 installed, then it sounds like your variables are correct, because javac is recognized. What specific error messages are you getting when you try to compile?


"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
Brenda Stevens
Greenhorn

Joined: Feb 11, 2011
Posts: 19
Thank You,

The error that I am receiving is that it is saying the file is not recognized. I thought maybe I had made a spelling error, but I have tried to compile other .java files and I keep recieving the same error message which is javac : file not found
marc weber
Sheriff

Joined: Aug 31, 2004
Posts: 11343

In Command Prompt, change directories (cd) to the directory that contains your .java source file. That's probably where you should be compiling from.

Type...

dir

...to get a listing of that directory. Is your .java source file listed there?
Brenda Stevens
Greenhorn

Joined: Feb 11, 2011
Posts: 19
Ok I have changed directories to where the file is and typed the command dir but it doesnt list any files which I have stored in that directory :|
marc weber
Sheriff

Joined: Aug 31, 2004
Posts: 11343

Can you paste exactly what your command prompt is showing when you change directories? For example...

H:\>cd java/tools
H:\Java\Tools>
Brenda Stevens
Greenhorn

Joined: Feb 11, 2011
Posts: 19
C:\users\jay> cd oscn
C:\users\jay\oscn>
C:\users\jay\oscn> javac UselessHTTPServer01.java
javac: file not found: UselessHTTPServer01.java
usage: javac <options> <source files>
use -help for a list of possible options

C:\users\jay\oscn
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60774
    
  65

"jay may", please check your private messages for an important administrative matter. Thanks.
marc weber
Sheriff

Joined: Aug 31, 2004
Posts: 11343

First, check Bear's message and handle that.

Next, can you paste exactly what you get when you type dir at C:\users\jay\oscn>

And if UselessHTTPServer01.java does not appear, are you absolutely certain that's where you've saved it?

(I'm starting to think it just doesn't like being called "Useless." )
Brenda Stevens
Greenhorn

Joined: Feb 11, 2011
Posts: 19
Yeah it is definately in that folder. I just tried to make a new folder and put a .java file into it and then tried to change the directory to the new folder but it said The system cannot find the path specified.

Ok after i have typed dir at C:\users\jay\oscn> the message i get is:

C:\Users\jay\oscn>dir
Volume in drive C has no label.
Volume serial number is 0402-9e21

Directory of C:\users\jay\oscn
08/11/2010 13.49 <DIR> .
08/11/2010 13.49 <DIR> ..
0 file(s) 0 bytes
2 Dir(s) 4,724,436,992 bytes free
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14074
    
  16

Brenda Stevens wrote:Yeah it is definately in that folder.

The output of the dir command shows that the folder is empty. So your source file is definitely not in that folder.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
Brenda Stevens
Greenhorn

Joined: Feb 11, 2011
Posts: 19
Ok I assumed it was in that folder becase when i looked in the folder via my documents is in there. Im now slightly confused as to if it is because of my enviroment variables because my user variables dont have anything but my system variables have both the home and the path in them.
For JAVA_HOME i have C:\Program Files\Java\jdk1.6.0_23
For Path i have C:\Program Files\Java\jdk1.6.0_23\bin
marc weber
Sheriff

Joined: Aug 31, 2004
Posts: 11343

Brenda Stevens wrote:Ok I assumed it was in that folder becase when i looked in the folder via my documents is in there...

In Windows, isn't "My Documents" somewhere like, C:\Documents and Settings\user\My Documents...? Perhaps the app you're using to save your .java file is not showing you a complete path?

When you save the .java file, try going all the way back up to "C:" and then down to your destination folder.
 
 
subject: Trying to install JAVA JDK
 
Similar Threads
Issues with checking that my JDK is configured properly
'javac' is not recognized as an operable program or batch file
Integrating jdk with netbeans?
Trying to install Java JDK... Not sure which variables to change
Struts Example not working!