Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi all,
Vanilla are planning an update to the site on April 24th (next Wednesday). It is a major PHP8 update which is expected to boost performance across the site. The site will be down from 7pm and it is expected to take about an hour to complete. We appreciate your patience during the update.
Thanks all.

JDK Issue - Javac not recognised

  • 04-10-2014 4:32pm
    #1
    Registered Users Posts: 218 ✭✭


    I'm using a different laptop and have installed the JDK and for some reason I'm getting the "javac is not recognised" error when I try and compile my programs in command prompt. I've specified the path files in environmental variables. Any ideas of other solutions I should look into? Thanks in advance.
    Tagged:


Comments

  • Registered Users Posts: 403 ✭✭counterpointaud


    Post the contents of your PATH variable, and also the location(s) of javac.exe
    echo %PATH%
    
    dir javac.exe /s /p
    
    (might take a while)


  • Registered Users Posts: 5,995 ✭✭✭Talisman


    JDK installation instructions : Updating the PATH Environment Variable


  • Registered Users Posts: 6,250 ✭✭✭Buford T Justice


    what os are you using?


  • Registered Users Posts: 1,192 ✭✭✭TarfHead


    I have a similar, but different, problem.

    I am new to Java, just started tuition in 2 weeks ago. I was provided with instructions for installing the SE Development kit on my PC (Win7, 64 bit) and for using Notepad++ to write code and macros for Compile, Run & Compile & Run.

    Everything is installed and the Notepad++ macros defined. JDK installed using 'jdk-8u20-windows-x64.exe'

    The Compile option runs OK, i.e. no reported errors. In other words, the macro is able to locate javac.exe.

    The Run macro fails with message;

    Process started >>>
    Error: Registry key 'Software\JavaSoft\Java Runtime Environment'\CurrentVersion'
    has value '1.7', but '1.8' is required.
    Error: could not find java.dll
    Error: Could not find Java SE Runtime Environment.
    <<< Process finished. (Exit code 2)

    The 'Run' macro comprises;

    cd "$(CURRENT_DIRECTORY)"
    java $(NAME_PART)

    When I look at the Windows Registry, using regedit, I see a value of 1.8 for Current Version in \HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Development Kit.

    I have seperately downloaded and installed the Java Runtime environment, but the error remains. JRE installed using 'jre-8u20-windows-x64.exe'

    And, when I run 'javac' and 'java' on the command line, they both work.

    Any hints, tips ?


  • Registered Users Posts: 7,157 ✭✭✭srsly78


    Update your notepad++, the java plugin is looking for an out of date version. Alternatively just edit the registry yourself. Maybe it's looking for 32bit java?


  • Advertisement
  • Registered Users Posts: 1,192 ✭✭✭TarfHead


    Thanks
    The registry shows 1.8 and Notepad++ is 'reading' 1.7. I have uninstalled and installed Notepad++ several times.


  • Registered Users Posts: 7,157 ✭✭✭srsly78


    Notepad++ does not work with the latest java it seems, so you have to manually hack it - or download the old java that it expects.

    Try following all the steps here: https://www3.ntu.edu.sg/home/ehchua/programming/howto/JDK_Howto.html

    Notepad++ config info here, mess around with this until fixed: https://www3.ntu.edu.sg/home/ehchua/programming/howto/CMD_Survival.html#NotePadPP
    Try editing JavaRun.bat and JavaCompile.bat.


  • Registered Users Posts: 1,192 ✭✭✭TarfHead


    I copped on to a different solution. Instead of just the 'java' command and relying on Notepad++/Windows to resolve the path, I put in the full directory reference to java.exe and it now works fine.

    replace java $(NAME_PART)
    with C:\Program Files\Java\jdk1.8.0_20\bin\java $(NAME_PART)

    Thanks for your help


Advertisement