Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Java Local Development Environments How it Works Installation

Edward Strudwick
Edward Strudwick
2,036 Points

Installed JDK during 'Introducing IntelliJ and Unpacking Packages' tutorial, but cmd/powershell returns nothing..?

As above, I installed the latest JDK when setting up IntelliJ as directed by the tutorial with Ben. When I stick java -verison into powershell/cmd (running Windows 10) it returns: "java: the term 'java' is not recognised as the name of a cmdlet, function...."

IntelliJ runs fine and sets the Project SDK as 16 version 16.0.1 so I think I have it somewhere? (edit the file path seems to be: C:\Users[me].jdks\openjdk-16.0.1\bin

ANy ideas?

I assume this is because I downloaded the JDK package from within the IDE rather than manually downloaded it and defined it within IntelliJ. But not sure why I get the error.

Edit: I tried the method used here and still get the same error - https://teamtreehouse.com/community/problem-getting-version-of-java-in-powershell-in-windows

1 Answer

Edward Strudwick
Edward Strudwick
2,036 Points

I'm going to answer this myself in case anybody ever needs it, having worked it out.

IntelliJ default stores the JDK here (or did for me anyway): C:\Users[me].jdks\openjdk-16.0.1\bin

So the solution was to use that path and add \java -version to the end. This worked for me, so it was:

C:\Users[me].jdks\openjdk-16.0.1\bin\java - version.