Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Bewildered!!!!!!!!

 
Judith
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey All,
Sorry to be such a pain, but in desperate measures, I am
back because I HAVE to get this to work.

I simply cannot get the classpath to work.
I have moved j2sdk1.4.2_06 to C:\Temp and at the
dos prompt it keeps telling me that 'javac' is not recognized.
I then dl The Java 2 SDK in hopes that I hadn't dl the correct version of java. (i am desperate)
I have been to Microsoft's site and I have read the links you guys have put up. Thank you by the way...
I have
Here's about all that the C:\ prompt will let me do.
when the window opens, i get C:\Documents and Settings\My Name.
I then type cd C:\Temp
and it does.
(now both versions of the java program is in the Temp folder)
I then type set classpath=
I then try to compile using javac.
nothing happens.
i feel like a retard!! lol
I read fully the post of Jackii Jonsen, and followed it, but
still nothing happened.
(http://www.coderanch.com/t/398201/java/java/having-trouble-running-Java)
please help...
thanks for your patience..
Moxyi3
 
Judith
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
it keeps telling me
it is not recognized or not an internal command.
i have even typed 'javac' after bin, but nothing happens that
way either.
???
C:\Temp\Sun\AppServer\jdk\bin

so i guess, the question is why wouldn't this work???
thanks,
moxyi3
 
Ioan Sirbu
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey did you set your Environment variable up correctly?



And your Path should include



If you can't figure out the pathing issue after checking the big FAQ

http://faq.javaranch.com/view?HowToSetTheClasspath

,come back here and post all your pathing information..

-Ioan
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello "moxyi3",

please take a look at our naming policy and adjust your display name in your profile. Thanks!

And for getting more answers to your questions, you might want to use more expressive subject lines.

Anyway, have fun at the Ranch!
 
Layne Lund
Ranch Hand
Posts: 3061
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When beginning to learn Java, typically CLASSPATH should not be set to any value at all. The problem you are encountering is becuase the PATH variable is not set correctly. Your operating system uses PATH to find programs that it can run. In this case, the OS needs to know where to locate javac and java. As indicated by Ioan above, you need to make sure PATH include your JDK installation directory.

On the other hand, Java uses CLASSPATH to locate .class files when you run the program you wrote. If CLASSPATH is not set, then Java will only look in the current directory for .class files. When you are starting this is typically what you want, so you should probably not set the CLASSPATH variable.

Keep Coding!

Layne
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic