PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Monday, August 22, 2022

[FIXED] How to get java command running?

 August 22, 2022     environment-variables, java, windows     No comments   

Issue

When working with any command line (windows-cmd, git bash, ..), no Java commands are working.

I executed java -version and nothing happens. I can type again.

I have set my JAVA_HOME variable to C:/Users/myName/Java/jdk1.8
and I have also added %JAVA_HOME%\bin to my Path variable.

It's not, that the command does not get recognised. It's just that nothing happens.
I could probably run the java.exe command directly, but I wanna fix the env variable.

Can someone help?

Best regards

enter image description here


Solution


Try this (Windows):

  1. Locate your JDK/JRE binary - Usually the path for your JDK/JRE bin (On Windows) is:

    Your OS Drive(C or D etc):\Program Files\Java\jdk[version]\bin. After you've located it, Copy your path to your clipboard.

  2. Search for "Environment Variables" on windows.

  3. Create a new User variable name it (usually named "JAVA_HOME") and copy your path as a value.

    enter image description here

    Now in System variables locate a variable named "Path" and add the same value set in JAVA_HOME.

  4. Close and then reopen the CMD.


If this solution does not work, reinstall java. You can uninstall through:

Control Panel -> Programs -> Under Programs and Features -> Uninstall a program.



Answered By - InSaNiTy
Answer Checked By - Terry (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

1,213,774

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © 2025 PHPFixing