TFS2017 Code search configuration at TFS2017 Admin console - java-8

While configuring Search feature at TFS2017 admin console I am getting below error & configuration is getting failed. Although i have installed JDK 8.0 & server JRE8 update 20 & set the environment variable JAVA_HOME but still issue persists. Can someone help me out on this. Please suggest.
"Search requires Oracle Server JRE 7 Update 55 or higher, or JRE 8
Update 20 or higher, and a suitable version was not detected or is not
correctly configured on this computer. You can download and install
the latest version by accepting the Oracle Binary Code License
Agreement for Server JRE and selecting ‘Configure’. Note that this
will set the JAVA_HOME environment variable to point to the Java
installation directory, and that Server JRE does not provide automatic
updates. See Java installation notes for more information."
Serach Config Wizard screenshot

Please see Java installation notes for Code Search configuration, make sure you have set the environment variable correctly.
For example: as a variable name choose JAVA_HOME and as value set the path of the folder where JRE is installed, eg C:\Program Files\Java\jre1.8.0_11,
If the Search configuration wizard does not detect a working
installation of Java Server JRE, it provides an option to download and
install the latest version. Internet connectivity is required to
download this from the Java website. If the target server does not
have Internet connectivity, you must download and install Server JRE
manually before attempting to install Code Search.
During installation, the wizard sets the JAVA_HOME environment
variable to point to the Server JRE installation folder. The
configuration wizard may fail to detect an existing Server JRE
installation if it is not correctly configured, or if the
JAVA_HOME setting points to an earlier version than that required by Code Search.
If there is a version of Server JRE earlier than the minimum
required by Code Search, and the JAVA_HOME variable is set to that
version, we recommend you install Search on a separate server because
changing the value of the JAVA_HOME variable may cause other
installed software to fail.
If there is a version of Server JRE equal to or later than the
minimum required by Code Search, and it is not recognized by the
configuration wizard, you must set the value of the JAVA_HOME variable
to that version as described in the Java troubleshooting guide,
and then rerun the configuration wizard.

This looks like an intermittent issue for me. I had to get Azul openJDK8
and JAVA_HOME in Environment variable set to
"C:...\zulu8.54.0.21-ca-jdk8.0.292-win_x64\zulu8.54.0.21-ca-jdk8.0.292-win_x64\"

Related

IntelliJ IDEA - No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?

I am trying to clean maven project using IntelliJ on mac by running below command but getting error. Please suggest what needs to be done to fix this
./mnwn clean package
Error : "No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?"
Thanks
The issue is not related to IntelliJ IDEA, you should get the same behavior when you run this command in the system Terminal.
To fix the issue install any JDK on your system and make sure the bin subdirectory of the JDK home directory is added to PATH environment. You may also want to set JAVA_HOME environment variable pointing to this JDK installation home directory.
To verify that it works run java -version in the system Terminal. Make sure it prints the correct Java version of the JDK and not a JRE.
I was facing similar error while workspace setup on a new MAC system.
I was initially referring "/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin" as JAVA_HOME path but it was not correct.
The correct JDK path was "/Library/Java/JavaVirtualMachines/jdk1.8.0_331.jdk/Contents/Home". If you JDK with default installation path on MAC then cross check your JAVA_HOME. It might help you to solve your problem.

Issue with JDK installation

I have install JDK 8 kit.
I have set path variable to jdk bin
D:\Java\jdk1.8.0_181\bin
and home to jdk.
D:\Java\jdk1.8.0_181
I am able to see the version in cmd promt when I give java -version. But when I give javac - version its not able to find the jdk? Can anyone say what could be wrong?
On windows after installation (if no other java's are there) it should work out of the box - if not you should set JAVA_HOME to D:\Java\jdk1.8.0_181 and add JAVA_HOME\bin to the path. If you do so you have to restart any already open commandline - because they will not get the JAVA_HOME/PATH updates (if you did them via the windows system control).
You could test what java -version tells you first - to find out if a runtime environment is still referenced.

Android Studio.Debugging does not work

I need to debug my app, but debugging does not work.There is a message in event log:
System Health
This IDE is running on a Java JRE instead of a full Java JDK.
This does not work; debugging (among other features) will not work.
You must configure the boot JDK (via Help > Find Action... > Switch
My JDK home path in Android Studio is C:\Program Files\Java\jdk1.7.0_79.
I have JAVA_HOME variable: C:\Program Files\Java\jre1.8.0_111.I tried to change JAVA_HOME variable to C:\Program Files\Java\jdk1.7.0_79,but Android Studio did not start.
What should I do?
I ran into the exact same message with Android Studio 2.3.2.
I had installed Java SDK 7, and then accepted an update to Java 8.
After much ado following advises about setting environment variables JAVA_HOME, JDK_HOME, STUDIO_JDK and PATH in dozens of different combinations, I finally found out what at least my problem was and it's very simple indeed.
Turns out, the update to Java 8 was only for the JRE so the SDK was still 7, and Studio 2.3.2 requires JDK 8. So after installing that, not one single environment variable was necessary to get rid of the "This IDE is running on a Java JRE instead of" message.
Hope this helps.
/z

Error occurred during initialization of VM (java/lang/NoClassDefFoundError: java/lang/Object)

I'm trying to install Java to use Eclipse (I followed all instructions to install Java and Eclipse) but my Eclipse is not starting due to some bad configuration I guess. I can't figure out why it's not working for me.
Eclipse Installation:
Extracted Eclipse at C:\eclipse
Created a shortcut to my desktop having target C:\eclipse\eclipse.exe
When I try to run Eclipse with this shortcut, I see following Eclipse splash screen for a second and it disappears. Eclipse does not start at all.
JAVA Installation:
Installed JDK at C:\Program Files\Java\jdk1.7.0_10
Installed JRE at C:\Program Files\Java\jre7
Environment Variables Configuration:
JAVA_HOME = C:\Program Files\Java\jdk1.7.0_10
PATH = C:\Program Files\Java\jdk1.7.0_10\bin;
I tested my Java installation using the console and figured out this issue but I don't know how to fix it, and I guess this is causing Eclipse not to start.
Problem:
Go to Eclipse folder, locate eclipse.ini file, add following entry (before -vmargs if present):
-vm
C:\Program Files\Java\jdk1.7.0_10\bin\javaw.exe
Save file and execute eclipse.exe.
please try to execute java from
C:\Program Files\Java\jdk1.7.0_10\bin
i.e from the location where java is installed.
If it is successful, it means that the error lies somewhere in the classpath.
Also, this guy seems to have had the same problem as yours, check it out
Check that downloaded eclipse/JDK/JRE is compatible with your processor/OS architecture that is are they 32bit or 64bit?
Not able to run Appium {“message”:”A new session could not be created. (Original error: ‘java -version’ failed
I used Jdk 1.8 and JRE 1.8, Classpath is also set properly but I observed that Java command gives Error to initialization of VM (java/lang/NoClassDefFoundError: java/lang/Object)
Solution:
Uninstalled JRE and JDK completely
Installed JRE 1.8 then
Installed JDK 1.8
Set Classpath
check Java command works or not and its working
also able to execute the Appium program thru Eclipse Kepler Service Release 2 with JDK1.8 support
I had the same error in my case was when I needed to update jdk 7 to jdk 8, and my bad was just I installed jdk8 and I never installed jre8, only that, the error was solved immediately when I installed jre8.
Try placing the desired java directory in PATH before not needed java directories in your PATH.
I had the same issue on Windows 7 and I had to install both JDK and JRE and it's a success.
I faced the same problem,Eclipse splash screen for a second and it disappears.Then i noticed due to auto update of java there are two java version installed in my system. when i uninstalled one eclipse started working.
Thanks you..
I've observed this with STS and Eclipse and running java from CMD too on Windows 7/8/10 and following was my simple solution:
Actually, when I installed JDK 8 and STS/Eclipse it created one directory i.e. C:\ProgramData\Oracle\Java\javapath with the following files:
C:\ProgramData\Oracle\Java\javapath\java.exe
C:\ProgramData\Oracle\Java\javapath\javaw.exe
C:\ProgramData\Oracle\Java\javapath\javaws.exe
Along with that, it appended Path Environment variable of System with this location C:\ProgramData\Oracle\Java\javapath
I've just removed above entry from Path Environment variable of System and added the location of the actual JDK instead i.e. C:\Program Files\Java\jdk1.8.0_131\bin
Now that is not necessary to add that -vm option in eclipse.ini or
SpringToolSuite4.ini either.
I just spent about 1 hour to figure out possible solution for the same error.
So what I did under MS WIndows 7 is following
Uninstall all Java packages of all versions.
Download last packages Java SE or JRE for your 32 or 64 Windows and install it.
First install JRE and second is Java SE.
Open text editor and paste this code.
public class Hello {
public static void main(String[] args) {
System.out.println("test");
}
}
Save it like Hello.java
Go to Console and compile it like
javac Hello.java
Execute the code like
java Hello
Should be no error.
sometime you missed some file like I missed my one file rt.java
so better to check yours .........
C:\Program Files\Java\jdk1.8.0_112\jre\lib
0
I just spent about 1 hour to figure out possible solution for the
same error.
So what I did under MS WIndows 7 is following
Uninstall all Java packages of all versions.
Download last packages Java SE or JRE for your 32 or 64 Windows and
install it.
First install JRE and second is Java SE.
List item
Below error is thrown when there are multiple versions of jdk on your machine:
error occurred during initialization of VM
java/lang/NoClassDefFoundError: java/lang/Object
so for this Just use below:
set PATH="JDK bin path" in cmd
I had a same issuse, my file location was in D-drive, and then i shifted to the c-Drive and it works.

How to prevent that java.exe is installed in Windows' system32?

Is there a way to prevent that the Java installation routine (e.g. jdk-7u1-windows-i586.exe) copies java.exe into C:\Windows\system32 directory?
I have to install my software on a client's laptop and I don't want to break other Java applications which are already installed on the machine. In other words I want to install a private JRE which is only used by my software.
By now, I copied an already installed JRE from my computer to the client's machine.
I discovered yesterday that there is a problem with Java versions on Windows, as you know keeping java up to date these days is critical, especially the JRE used by Internet explorer located in the Windows system32 or syswow64 folder.
You can perform a search for java in your C: drive and look at the various executable files it finds to determine if the situation applies on a specific system.
After doing some research I find that when the Java updater runs, it only updates the files installed in the JAVA home , usually located on the program files, but it does NOT update the files located in the windows system folder. As a result and since the system folder is in the default system PATH , the usage of Internet Explorer continues to use an old version of the JAVA files ( java.exe , javaw.exe , javaws.exe )
The solution is to uninstall java using the control panel uninstall programs feature, download most recent version and install again.
Cheers!
Fernando
I recently upgraded to java 8 and discovered this problem as the java version under system32 was still java 7. It stops you even running version as it complains about the registry keys
U:\>java -version
Error: Registry key 'Software\JavaSoft\Java Runtime Environment'\CurrentVersion'
has value '1.8', but '1.7' is required.
Error: could not find java.dll
Error: Could not find Java SE Runtime Environment.
Doing the following pointed me to the culprit:
U:\>where java
C:\Windows\System32\java.exe
C:\Program Files\Java\jdk1.8.0_45\bin\java.exe
I 'solved' this problem by just deleting the java under system32! I'm unsure of what consequences this will have.
You can just provide the JRE you want to use on your software and:
Set the JAVA_HOME variable before you run your application
Point to the correct java.exe file (e.g. ..\jre1.5.0_22\bin\java <your_java_main>)
This can be done in a *.bat file for example.
After running the *.bat file you created, all other java version will be ignored and it won't matter which versions are, or will be, installed on that pc.
I found the newest JDK still doesn't write correct code against registry.
The issue is if a computer doesn't have JRE, JDK doesn't register JRE in registry correctly.
For those install JDK 1.7u72 Just add Software\JavaSoft\Java Runtime Environment as the error message indicate. And add a string entry of CurrentVersion with value 1.7.
And then add Software\JavaSoft\Java Runtime Environment\1.7 and put a JavaHome string entry with value "C:\Program Files\Java\jre7". And JRE will function correctly.
Blame Oracle, if you use Registry, then write correct code, otherwise don't use the Registry!
All you have to do is go to Control Panel -> Programs Uninstall a program. Uninstall the old java updates and keep the newest java update and java development kit update. Your newest java update and java development kit update should have the same number.
Windows 10 Solution
Check Java Version in Console (CMD) with java -version
Check in Console (CMD) with where java, which Java Path's are enlisted.
If it you shows you "C:\Windows\System32" in its output, you will have a problem to get to your %JAVA_HOME%, where your wanted Java version resides.
Meaning, you need to get rid of "java.exe" in "C:\Windows\System32".
Just uninstall the JRE in the Software ("Programs and Features")
Hint: Keep in mind, do NOT the JDK, here in my case "Java SE Development Kit 8 Update (64-bit)"), but the JRE.
One way I would try would be to create a write-only empty file with the name java.exe into the System32 folder.

Resources