Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Typesafe activator: Java JDK can't be found

Tags:

typesafe

I am trying to run the typesafe activator on Windows 8.1 x64. It keeps saying I don't have a valid JDK installation:

A Java JDK is not installed or can't be found.
JAVA_HOME = "C:\Program Files\Java\jdk1.7.0_45\bin"

Please go to
http://www.oracle.com/technetwork/java/javase/downloads/index.html
and download a valid Java JDK and install before running Activator.

If you think this message is in error, please check
your environment variables to see if "java.exe" and "javac.exe" are
available via JAVA_HOME or PATH.

Press any key to continue . . .

I have my JAVA_HOME set to:

C:\Program Files\Java\jdk1.7.0_45\bin

Which is a valid location.

like image 808
Notso Penguin Avatar asked Jan 07 '14 03:01

Notso Penguin


2 Answers

JAVA_HOME should just point to the JDK directory, not bin.

like image 55
Thorn G Avatar answered Sep 19 '22 22:09

Thorn G


Here was my workaround:

Add the following code to your activator.bat on line 112:

if "%JAVAOK%"=="false" (
   set "_JAVACMD=C:\Program Files (x86)\Java\jdk1.6.0_91\bin\java.exe"
   set "JAVAOK=true"
   set "JAVA_VERSION=1.6"
) 

Or where ever your java.exe is located at, and whatever your Java Version is.

Your code should now look like:

rem BAT has no logical or, so we do it OLD SCHOOL! Oppan Redmond Style
set JAVAOK=true
if not defined JAVAINSTALLED set JAVAOK=false
if not defined JAVACINSTALLED set JAVAOK=false

if "%JAVAOK%"=="false" (
   set "_JAVACMD=C:\Program Files (x86)\Java\jdk1.6.0_91\bin\java.exe"
   set "JAVAOK=true"
  set "JAVA_VERSION=1.6"
) 

if "%JAVAOK%"=="false" (
  echo.

When I typed "path" in cmd, I got my classpath, but "java_home", "java -v", etc didn't work. I don't know why I am having that issue, but my (ugly) workaround worked.

like image 33
mike d Avatar answered Sep 19 '22 22:09

mike d