Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Java

In cmd prompt ,"javac -version" not working properly even though i installed jdk.

.

2 Answers

Ken Alger
STAFF
Ken Alger
Treehouse Teacher

Nazifa;

Try java -version. That works for me in Windows CMD and Bash.

Ken

Thnx a lot :)...it worked.

Hi Nazifa,

Technically also a java compiler will have it's version, similar to the java interpreter. So what you tried was not incorrect. Did you try using only javac? If that's not working then you didn't set the environment variables properly.

The image is from a Mac OS, but then I've tested the same on Windows.

Hope this helps

Imgur