Do user computers of a java program need to have JAVA_HOME environment variable set or only while developing and compiling? - java-home

I am just getting started on a java program and wanted to know when I complete the program will the client/user computers of my java executable need to have the Java_home variable set or is this only for the development environment.

Related

Environment Variables in MacOS Big Sur for Maven

I have MacOS Big Sur and inside of the /Users/us-guest/ doesn't exist the
.bash_profile
and I need to add environment global PATH for maven, however, I have installed Java 11 and I don't need to set up any environment variable and without problem, if you write java -version my console respond and in fact, if you use printenv I can see the setup variables current in the system.
Why do I need to set up an environment variable for maven and not for
Java?
Can I create a file bash_profile without affecting the environment
variables established in the system?
https://i.stack.imgur.com/jfo18.png
https://i.stack.imgur.com/dfmmY.png
https://i.stack.imgur.com/cmvyI.png

cl.exe is not being found in path variable but works after having been added programatically [duplicate]

Sometimes when I change my environment variables in Windows, and then use software the depends on those variables, they are not properly updated.
And good example is to change a variable, then open up Windows Command Line and echo the variable and see that it hasn't been changed, even though you properly changed it in the Environment Variables window.
Another example I'm dealing with right now:
I've been using Python 2.4.x for a while for a project, which uses the env var PYTHONPATH who's value has been:
C:\Python24;C:\Python24\lib
Today I installed Python 2.5.x for the project. I changed my PYTHONPATH to be:
C:\Python25;C:\Python25\lib
When I use Python 2.5 to run a script and do this:
import sys
print sys.path
It prints:
'C:\\PYTHON24', 'C:\\PYTHON24\\lib' (and some other Python 2.5 related default installation paths)
So clearly, the old PYTHONPATH environment variable changes aren't really sticking....
Does anyone know why this happens and how to fix it?
When you change an environment variable in the System Properties tab, the new value will propagate to the Windows Explorer, and any apps (such as cmd.exe) opened from the Windows Explorer (or the Run box, Start Menu, etc.) should see the new value.
However, if you're running a program such as an editor or python or some non-Microsoft program launcher, then change an environment variable, and then launch cmd.exe from that program (instead of Windows Explorer) you are likely to see the old value of the environment variable. The reason is that the running program ignored the notification from Windows saying that the environment has changed (not at all unusual), and since the launched process inherits the environment variables, the child process won't see the changes.
The workaround is to make sure you start your app from Windows Explorer or the Run box. Rebooting your machine will work also (if rebooting doesn't solve the problem, then something else is going on).

I can't get environment variables using CMake in Windows 10

I added THIRD_PARTY environment variable in Windows 10
and I tried using $ENV in CMake to load the path.
But, it failed. When checked using the CMake message function, nothing is output.
I checked the environment variable path once more.
I don't know what my problem is. Please help me.
You need to close and reopen your console or Visual Studio window after adding or changing the environment variable.
The environment is only passed to a program at startup. Later changes to the environment are not propagated to running programs.

how to do spark installation process on windows 8 environment

I need to install spark 1.0.0 on my laptop, which has 64 bit OS windows 8, , java(java version "1.7.0_25"). I downloaded "spark-1.0.0-bin-hadoop2". But i don't know how to install spark 1.0.0. I also searched in Google but i can't find it properly. So can you please tell me the installation steps on windows 8 OS and what any other things are needed for this process ?
You just extract the file you downloaded and you're good to go. You can now run bin/spark-shell to start experimenting.
If your cluster environment runs Linux though, I would recommend using Linux for experimentation/development as well. Having a matching environment will avoid a number of issues.
Install Java 7 or later. Set JAVA_HOME and PATH variable as environment variables.
C:\java-version
Download Scala 2.11 or Scala 2.12 and install. Set SCALA_HOME and add %SCALA_HOME%\bin in PATH variable in environment variables.
To test whether Scala is installed or not, run following command in command prompt.
C:\scala -version
Download and extract it to any drive i.e. c:\program files\spark-1.2.1-bin-hadoop2.3.
Set SPARK_HOME and add %SPARK_HOME%\bin in PATH in environment variables
Run following command on command prompt.
C:\program files\spark-1.2.1-bin-hadoop2.3.\bin\spark-shell
Thats it. this is for windows OS.

configure the jre version on windows 7 (32 bit)

I have java jre7 installed and also jre6, but the current version that is in use is the jre7. How do I tell windows to use the jre6 instead of 7? I've seen some guides of how to do so but it seems that they related to winXP since they were dealing with the JAVA_HOME variable (which does not exist on win7).
I've tried to add the path of the bin folder of the jre6 to the PATH environment variable but it didn't work. Do you have any other ideas?
By the way - I do want my eclipse to run the jre7, so I figured out I need to add/change lines in the eclipse.ini file, what exactly do I need to do there?
Thanks in advance,
Guy
Like on other windows versions (and by the way like on linux too), you have to set the JAVA_HOME environment variable.
If this var doesn't exist yet, it simply means you have to create it.
Here's how you can set an env variable on Win7 : http://www.windows7hacker.com/index.php/2010/05/how-to-addedit-environment-variables-in-windows-7/
For Eclipse, go in the preferences, choose java/installed JREs and choose the one you want. But for most of your other java based programs, the JAVA_HOME is really the important variable (along with the PATH).

Resources