Java not working properly (Windows 10- Java kit 10.0.1) (EDIT: Now need help fixing kit 8u241)

Discussion in 'Server & Community Management' started by ControlFryPan, Feb 17, 2020.

  1. I'm not sure whether this is the right section to post this, but anyway here I go.

    So my Java isn't working when I go onto Command Prompt and try to type javac, saying
    "'javac' is not recognized as an internal or external command,
    operable program or batch file." I already checked to make sure my Path variable, in System environment variables, were correct, and it shows this:
    PATH=C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Java\jdk-10.0.02;C:\Program Files\Java\jre-10.0.02;C:\Users\(No name here as it shows my last name)\Data\Local\Microsoft\WindowsApps; (Semi-Colons bolded to show they're new lines if you click edit, you can also do Ctrl-f and type ; if you cant see the semi colons).

    As I'm sure I did, I linked both bin files from JDK and JRE, along with typing cmd in Command Prompt. I've also removed former Java programs + downloaded new ones to make sure I wasn't downloading faulty Java downloads. Oh, and my JAVA_HOME is C:\Program Files\Java\jdk-10.0.1\ and thanks for trying to help me if you do.
     
  2. Oh yea, I also did it for Java 8 but it wouldn't work - I did the exact same thing but renamed the folders instead of (JRE and JDK 8...) to just jre and jdk. It also wouldn't work
     
  3. javac isn't a command. What do you get if you type: java -version
     
  4. Oh uh, I would get something similar, as it not working, I'm trying to use Java 8 (just learnt I added unnecessary ;'s for that lol).
    I'll just edit it up when I follow the same instructions, correctly.
     
  5. Oh so uh I did java -version with Java kit 8u241. I linked both bins and added a JAVA_HOME with the Jdk link, yet it still says
    Error: could not find java.dll
    Error: Could not find Java SE Runtime Environment.

    The JAVA_HOME is in my User Variables this time, and Path is in System Variables. I do however have a Path var. in System Variables, which I'm too afraid to mess around with (Ik you're supposed to "mess around in actual coding like experiments, but this is the primary thing - and only one answer to it usually from my perspective, tho im prolly wrong lol). I also checked that my Computer is 64 bit, which it is in fact, and also this is for Windows 10.

    bump
     
    #5 ControlFryPan, Feb 19, 2020
    Last edited: Feb 19, 2020
  6. Windows OS searches the current directory and the directories listed in the PATH environment variable for executable programs. JDK's programs (such as Java compiler javac.exe and Java runtime java.exe) reside in directory "\bin" (where denotes the JDK installed directory, e.g., C:\Program Files\Java\jdk1.8.0_xx). You need to include the "\bin" directory in the Java Path.

    • First make sure you have installed jdk and jre, both are installed with the java software development kit. The installation folder is typically C:\Program Files\Java.
    • Now go to Computer > Properties > Advanced system settings in the advanced tab click on Environment Variables
    • In System variables find the variable named Path, in the value of Path you will find a java path like C:\ProgramData\Oracle\Java\javapath, just change it to C:\Program Files\Java\jdk1.x.x_x\bin.