JRE_HOME environmental variable is not defined correctly bamboo error - bamboo

When i ran start-bamboo.bat file from windows command prompt. I faced the below errors even though JRE_HOME is defined.
The JRE_HOME environment variable is not defined correctly This
environment variable is needed to run this program

This means that your environment didn't have JRE_HOME or JAVA_HOME environment variable set properly. You can check the validity of the path by typing in your command prompt
echo %JAVA_HOME%
echo %JRE_HOME%
If it is not set, follow the instructions mentioned in the Atlassian Documentation Setting the JAVA_HOME Variable in Windows and run your start-bamboo.bat in the same command prompt.

This worked for me, use the JAVA_HOME with shortened path but let the JRE_HOME with the full path:
JAVA_HOME: C:\Progra~1\Java\jdk1.8.0_101
JRE_HOME: C:\Program Files\Java\jre1.8.0_144
Hope it helps.

Setting just the JDK worked for me. You can try if other answers don't work for you.

Related

How to update JAVA_HOME for the entire system, not just my terminal?

When I swap my JAVA_HOME to point to another env and close terminal and open it back up, I can echo it and it shows the right path.
However some other applications (name IntelliJ IDEA) will hold the first JAVA_HOME until I log my user out. Simply quitting IntelliJ IDEA like terminal doesn't work.
Why is this? I'm curious where does someone like IntelliJ actually get my JAVA_HOME in case I have one set in my bash_profile and my config_fish for instance. How does intellij (and other programs) know where to look?
Not Sure about IntelliJ but in eclipse, you can set your environment in Window > preference > java > Installed JRE and add your path their
Okay, so there are such things as system env variables but in this case intellij wasn't pulling these from my system. Intellij instead knows how to look for your bash_profile among other configs (also zsh config and fish config)
See the source here: https://github.com/JetBrains/intellij-community/blob/master/plugins/terminal/resources/jediterm-bash.in

How to properly set environment variable TERM in CLion

Using CLion on OSX, I'm creating a simple console app in which I want to do a system("clear"). When I'm running the app in the OSX terminal, it works without issue. When I run it using the CLion terminal, the system("clear") fails with message :
TERM environment variable not set.
I first tried to manually set it in my cmakelists.txt file without success by doing
set(ENV{TERM} "xterm-256color")
I then tried to manually set it (followed by full restart) in CLion settings for both Console and CMake sections in Build, Execution, Deployment using the following key/value pair (Environment option):
TERM xterm-256color
In my OSX terminal, doing a env | grep TERM prints out
TERM_PROGRAM_VERSION=388
TERM_PROGRAM=Apple_Terminal
TERM=xterm-256color
What am I missing? I unfortunately can't find it...
Finally found the fix. You must add the Environment Variable TERM=xterm-256color not in the Console or the CMake config bug in the your Run/Debug configuration.

Setting up and using environment variables in IntelliJ Idea

I set up an environment variable (Under IDE Settings -> Path Variables)
APP_HOME = /path/to/app_home
One of my tests is failing however with
System.out.println("APP HOME: " + APP_HOME);
With
APP HOME: null/
It does not look like that env variable is being read. What am i missing?
Path Variables dialog has nothing to do with the environment variables.
Environment variables can be specified in your OS or customized in the Run configuration:
I could not get environment variables to work when IntelliJ Build and run property was using Gradle. I am not sure what the root cause is, but switching to IntelliJ IDEA solved the problem. Go to Preferences -> Build, Execution, Deployment -> Build Tools -> Gradle. Then change Build and run using: to IntelliJ IDEA.
If the above answer + restarting the IDE didn't do, try restarting "Jetbrains Toolbox" if you use it, this did it for me
It is possible to reference an intellij 'Path Variable' in an intellij 'Run Configuration'.
In 'Path Variables' create a variable for example ANALYTICS_VERSION.
In a 'Run Configuration' under 'Environment Variables' add for example the following:
ANALYTICS_LOAD_LOCATION=$MAVEN_REPOSITORY$\com\my\company\analytics\$ANALYTICS_VERSION$\bin
To answer the original question you would need to add an APP_HOME environment variable to your run configuration which references the path variable:
APP_HOME=$APP_HOME$

MonkeyTalkIDE not found Java (JRE) / (JDK) virtual machine

I am trying to install MonkeyTalkIDE but show this error
A java Runtime Environment (JRE) or Java Development kit (JDK) must be available in order to run MonkeyTalkIDE. No Java virtual machine was found after searching the following locations: C:\Program Files\MonkeyTalkIDE\jre\bin\javaw.exe javaw.exe in your current PATH.
I am also set environment variable for java.
How can resolved problem?
Download a Java JDK here.
You might need to set JAVA_HOME to point to the directory where you install Java. (I'll assume you know how to do that.)
set JAVA_HOME=<directory-where-you-installed-JDK>
Add the path to the Java /bin directory to your PATH environment variable. (I'll assume you know how to do that.) If you do the second step, it'll be
PATH=%PATH%;%JAVA_HOME%\bin;

Error occurred during initialization of VM

I'm getting the following error when running an executable I created on a 64-bit machine using C++ code:
"Error occurred during initialization of VM
Unable to load native library: Can't find dependent libraries"
My PATH (shown below) obviously points to jvm.dll since I have that file in both C:\Progra~1\Java\jdk1.6.0_17\jre\bin and C:\Windows\System32
PATH=C:\Program Files (x86)\Gmake\bin;C:\Program Files (x86)\apache-ant-1.7.1\bin;C:\Progra~1\Java\jdk1.6.0_17\bin;C:\Program Files (x86)\Microsoft Visual Studio 8\Common7\Tools;C:\Progra~1\Java\jdk1.6.0_17\jre\bin\server;C:\Progra~1\Java\jdk1.6.0_17\jre\bin;C:\Windows\System32
Does anybody have any ideas as to what would cause this error? Thanks.
Use dependency walker to figure out what dll is missing.
I have the same issue when I run the java.exe in my Windows2008 R2 version.
my path was
PATH=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32
\WindowsPowerShell\v1.0\;C:\Program Files\System Center Operations Manager 2007\
;C:\Java\jdk1.6.0_33\bin
when I run the java.exe under C:\Java\jdk1.6.0_33\bin, it works fine. I found that within the c:\Windows\System32\ comes with a copy of java.exe. When I run the c:\Windows\System32\java.exe, it shows the same error:
C:\>Windows\System32\java.exe
Error occurred during initialization of VM
Unable to load native library: Can't find dependent libraries
I fixed this issue by moving the C:\Java\jdk1.6.0_33\bin to the beginning of the PATH environment:
PATH=C:\Java\jdk1.6.0_33\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\
Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\System Center
Operations Manager 2007\
Hope this help.
This is how I solved a similar problem:
Used JavaRa: http://singularlabs.com/software/javara/ to remove old java versions.
Restarted the PC.
Re-installed the latest JDK version.
In my case, there was a jvm.dll file in the same folder as my exe file. I simply deleted the jvm.dll from there and it worked. Probably, it preceded the one in the PATH
I got this error as my PATH (environment variable) has not set correctly.
while setting PATH variable, set path of jvm.dll as a very first path in the list
Reboot your machine.
Note: Do not move jvm.dll to your project directory.
I had a complicated case. There was a jvm.dll file in the same folder as my exe file. I deleted it (because it shouldn't be there) but jvm.dll couldn't be find then.
I wanted to solve it by adding %JAVA_HOME%\jre\bin\server to my PATH because jvm.dll is located there. However, it didn't work. It turned out that the Windows loader won't expand the JAVA_HOME variable during searching for jvm.dll in the paths specified in PATH because I defined JAVA_HOME as user's variable. When I defined JAVA_HOME as a system variable, it started working as expected.