- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am trying to install SA-ldapsearch on my Win2008R2 search head. I installed the Server JRE and then defined JAVA_HOME=C:\Program Files\jdk1.7.0_25 and added C:\Program Files\jdk1.7.0_25\bin to the path. I restarted Splunk, but still when I try to use any of the ldap searches I get the following error: NameError: name 'JAVA_HOME' is not defined.
Anyone has an idea what's wrong?
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In SA-ldapsearch the commands that are being called are in the bin directory. They seem to be trying to read the following registry keys:
HKEY_LOCAL_MACHINE\Software\JavaSoft\Java Runtime Environment\CurrentVersion HKEY_LOCAL_MACHINE\Software\JavaSoft\Java Runtime Environment\($CurrentVersion)\JavaHome
It then tries to call java from the path at JavaHome plus \bin\java. If that fails it will try to read the JAVA_HOME environment variable. If you have something in the registry at those locations your JAVA_HOME will be ignored as it isn't the preferred method to define where Java is.
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
There is actually a bug in the scripts (all of them)
If your keys aren't defined--e.g. the latest server X64 installer for windows uses a tgz, not an MSI, so they're not--this is your fallback:
JAVA_EXECUTABLE = r'%s\bin\java.exe' % os.environ[JAVA_HOME]
No single quotes around JAVA_HOME. It can't work.
I have contacted the maintainer about this.
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In SA-ldapsearch the commands that are being called are in the bin directory. They seem to be trying to read the following registry keys:
HKEY_LOCAL_MACHINE\Software\JavaSoft\Java Runtime Environment\CurrentVersion HKEY_LOCAL_MACHINE\Software\JavaSoft\Java Runtime Environment\($CurrentVersion)\JavaHome
It then tries to call java from the path at JavaHome plus \bin\java. If that fails it will try to read the JAVA_HOME environment variable. If you have something in the registry at those locations your JAVA_HOME will be ignored as it isn't the preferred method to define where Java is.
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks, I couldn't figure out, why it didn't take my JAVA_HOME, but anyway I created the necessary reg keys in HKLM:SOFTWARE\JavaSoft\Java Runtime Environment. It's working now.
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for your support, I took a look at the python files and I saw, that it actually searches the windows registry for JAVA_HOME, so I created the necessary entries in HKLM:SOFTWARE\JavaSoft\Java Runtime Environment. Now it works.
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks, the issue is, that for security reasons I don't want to install the jdk-7u25-windows-x64.exe but would like to use the server version here: http://www.oracle.com/technetwork/java/javase/downloads/server-jre7-downloads-1931105.html
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Please don't extract it, Do a installation in the default folder. I think JVM is not installed properly. I did some research and i found that in the python files we have paths as C:\Program files(x86)\Java\jdk6/jre6 mentioned by default or it will search for the environment variable. I would urge you to remove the existing folder and delete the env variable. Do a fresh installation with jdk-7u25-windows-x64.exe, then set the environment variable. It should work perfectly.
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It's the Server JRE version, it's a Win-x64 tar.gz, which I just extracted to c:\program files\jdk1.7.0_25.
I tried your suggestion with removing the JAVA_HOME and do the set, but still the issue remains. Are there any logs, I can take a look at, to see what's wrong?
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Which version it is? 64-bit/32-bit? Delete the existing JAVA_HOME variable. set JAVA_HOME=C:\Progra~1\Java\jdk1.7.0_25 then check.. because i has the same issue setting up Java_Home.
and where did you install in program files / program files//Java directory?
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It didn't work.
Anyway when I type set in cmd I see the JAVA_HOME variable defined.
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
try run-> cmd
set JAVA_HOME=C:\Program Files\jdk1.7.0_25
that will do the job
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Did you restarted machine in order to guarantee that Windows will get the new env variable definition?
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I did, still doesn't work.
