Solved Java not found in command prompt

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Darrylt2016

Thread Starter
Joined
May 5, 2018
Messages
101
Hello dckeks,

I reinstalled Java on my computer and now it will not work in command prompt.

I tried to correct the path in environment variable but no luck. Can you help?

I added some photos to show what might be the problem.

Thanks, Darryl
 

Attachments

managed

Trusted Advisor
Spam Fighter
Joined
May 24, 2003
Messages
13,662
First Name
Allan
There is no such thing as javac, try java instead, you should get a help list about the command options.
 

managed

Trusted Advisor
Spam Fighter
Joined
May 24, 2003
Messages
13,662
First Name
Allan
You need to add the path to the java.exe file onto the Path system variable. In the Environment Variables window click on Path in the lower area > Edit > New, then type the path to java.exe (probably C:\Program Files\jre-10.0.1\bin\) and OK out.

To run java you may have to use an administrator command prompt, if so type CMD into the taskbar search area then right click on Command prompt at the top and select Run as Administrator.

What are you trying to do with java ?
 

Darrylt2016

Thread Starter
Joined
May 5, 2018
Messages
101
okay, I will try it and see what happens.

I also downloaded Eclipse and maybe that link is broken

I learn Java programming at Sololearn I know the basic and to build on it.

Alright, I tried that and it did not work.

last time I added jdk bin and jrk bin together separating them with semicolon on the same path and that work.

Then I type in javac in cmd and it work.

Shoud I type in jdk and jrk?
 

Attachments

Last edited:

managed

Trusted Advisor
Spam Fighter
Joined
May 24, 2003
Messages
13,662
First Name
Allan
Yes try that, you need the path to the java.exe and/or javac.exe files, I am working in Windows 7 so your paths and filenames may be different in Windows 10.
 

Darrylt2016

Thread Starter
Joined
May 5, 2018
Messages
101
yeah, maybe some different between 7 and 10.

I tried that and it did not work.

what if I click edit instead of new where the path is high lighted in bluc.

and enter jdk and jre there. Would that work?
 

Attachments

managed

Trusted Advisor
Spam Fighter
Joined
May 24, 2003
Messages
13,662
First Name
Allan
Edit will let you alter the highlighted line, New let's you type a new line in.

In File Explorer do a search for java.exe and/or javac.exe then add the path(s) to the path command.
 

Darrylt2016

Thread Starter
Joined
May 5, 2018
Messages
101
Where is file explorer and how do I use that?

Okay, I don't know if I done it right but I uploaded a screenshot.
 

Attachments

Last edited:

managed

Trusted Advisor
Spam Fighter
Joined
May 24, 2003
Messages
13,662
First Name
Allan
Click the folder icon on the taskbar to open File Explorer. It 's My Computer/Windows Explorer renamed for Windows 10. Then type your search item at the top right of it's window.
 

managed

Trusted Advisor
Spam Fighter
Joined
May 24, 2003
Messages
13,662
First Name
Allan
Add C:\Program Files\Java\jdk-10.0.1\bin\ into the path then javac should work in the Command prompt window.
 

Darrylt2016

Thread Starter
Joined
May 5, 2018
Messages
101
Hello,

Will you help me get netbean ide working again.

I tried opening netbean and got this message : Invalid jdk home specified

Cannot locate java installation in specified jdkhome
C:/Program Files\Java\jdk 1.8.0_171
Do you want to try t0 use default version?

Click on yes and got a message; Cannot find java 1.8 or higher.

Darryl
 

managed

Trusted Advisor
Spam Fighter
Joined
May 24, 2003
Messages
13,662
First Name
Allan
Looks like you have to tell Netbean where to look for jdk so try to enter the correct path into Netbean.
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Members online

Top