Java windows system32 path

How To Set Java, JRE and JDK Home Path and Environment Variables On Windows?

Java is a very popular programming language which provides a different component in order to run, develop Java applications. JRE or Java Runtime Environment is used to run Java application. JDK or Java Development Kit is used to develop Java applications. In this tutorial, we will learn how to set up Java, JRE, and JDK operating system path variables in order to work properly.

Locate JRE or JDK Path

Before starting the configuration we have to locate the JRE or JDK path. JRE or JDK generally installed on the Program Files or Program Files(x86) directory under the Java directory like below.

Locate JRE or JDK Path

and under the Java directory the JDK is residing.

Locate JRE or JDK Path

Set Java HOME_PATH Environment Variable

Now we have learned the path of the Java, JRE or JDK installation. We can set this path as Java HOME_PATH environment variable. We will open the computer properties with by running sysdm.cpl in the Run menu like below. We can also open it from the File Explorer -> Computer -> Right Click.

Open System Properties

In the system properties, we will navigate to the Advanced tab which provides the Environment Variables button like below.

Open Environment Variables

Below we can see the environment variables menu where we will create the JAVA_HOME system variable and set the path accordingly. We click to the New in order to create a new system variable.

Create New System Variable

Here we will set the Variable Name as JAVA_HOME and the Variable Value the path or Java, JRE or JDK which is C:\Program Files\Java\jdk-12 in this example. Then we will click OK.

Set JAVA Executable Path

If we want to run java.exe or similar executables provided by JRE or JDK we have to add the path of Java in the Path variable like below. We select the system variable named Path and click to the Edit .

Here we click to New which will add a new line to the existing values.

Here we will set the bin folder path which is C:\Program Files\Java\jdk-12\bin in this example.

Add Path System Variable

Then we will click OK and OK in the environment variables screen which will save and activated new path configuration.

Check Java Is Working

We can check the new path configuration simply opening a new command line interface MS-DOS. Then just type java -version which will execute java.exe with the -version option. We can see the current java binary version by running it.

3 thoughts on “How To Set Java, JRE and JDK Home Path and Environment Variables On Windows?”

What is the point in setting the JAVA_HOME to the path to the jdk install folder path if you then edit the Path variable and add the full path to the jdk bin folder? Shouldn’t you make use of the JAVA_HOME variable and add %JAVA_HOME%\bin to the Path instead.

Читайте также:  Параметры ipv4 вручную windows 10

@James Coffey, maybe the point of setting JAVA_HOME is just in preparation for GlassFish:
https://docs.oracle.com/cd/E19182-01/820-7851/inst_cli_jdk_javahome_t/index.html
Still, the author could make use of it in Path as you say, but maybe the author is just trying to keep it simple.

THANK YOU SO MUCH. YOU SAVED MY LIFE. I need to use java in jupyter

Java windows system32 path

Для того, чтобы начать программировать на языке Java, первоначально нужно установить программную среду на свой компьютер.

В этом уроке мы рассмотрим:

Скачиваем инсталлятор Java.

Скачать инсталляционный пакет можно на сайте компании Oracle по ссылке:

Качаем JDK последней версии (Java 7 или Java 8). Выберете в таблице (рис 1.1) вариант, подходящий для вашей операционной системы.

Дальнейшая установка будет рассмотрена на примере Windows. Если вы не знаете тип вашей Windows (x86 или x64) откройте Панель управления -> Система там будет указан Тип системы. Если тип вашей системы — 32 разрядная, то нужно устанавливать версию для x86, если 64 разрядная, то x64.

Внимание, перед тем как начать скачивание, нужно выбрать пункт Accept License Agreement вверху таблицы.

Если у вас компьютер Apple и на нем еще не установлена Java, то установочный пакет можно скачать отсюда: http://support.apple.com/downloads/#java

Инсталлируем Java.

Для того, чтобы установить Java на компьютер, запустите скаченный файл, после чего начнется процесс установки (рисю1.2).

Установка по умолчанию будет происходить в директорию C:\Program Files\Java\jdk1.x.x_xx (вместо иксов номер версии), при желании директорию можно изменить, нажав на кнопку Change (рис 1.3).

Следуйте инструкциям мастера установки, и через несколько минут установка будет завершена.

По окончанию установки, программа предложит перейти к технической документации и руководствам по Java, для чего нужно будет нажать кнопку Next Steps. После этого в вашем браузере откроется страница с документацией Java http://docs.oracle.com/javase/ , которая является очень полезной для изучения.

Настройка переменных сред.

На следующем шаге необходимо задать пути к выполняемым файлам, а именно задать системные переменные PATH, CLASSPATH и JAVA_HOME .

Для этого откройте Панель управления -> Система, выберете Дополнительные параметры системы. В появившемся окне нажмите кнопку Переменные среды.

В открывшемся окне в блоке Системные переменные нужно проверить существует ли переменная PATH, если переменная не существует, то ее нужно создать нажав на кнопку Создать, если переменная PATH уже существует, то ее нужно Изменить (рис. 1.4).

В следующем окне для переменной PATH нужно установить Значение переменной — путь к каталогу, в который была установлена Java (рис. 1.5).

Если переменной PATH уже присвоены другие значения, то новое значение добавляется через точку с запятой «;» в самом конце строки.

Также необходимо создать переменную CLASSPATH, если она еще не создана. В качестве ее значения необходимо указать «.;» (рис. 1.6).

Подобным образом создается/изменяется переменная JAVA_HOME. Значение этой переменной — путь к каталогу, в который была установлена Java (как для PAHT), но уже без поддериктории bin. Например:

Значение в PATH: C:\Program Files\Java\jdk1.7.0_25\bin

Значение в JAVA_HOME: C:\Program Files\Java\jdk1.7.0_25

После того, как были прописаны переменные, установку Java можно считать завершенной!

Проверка установки.

Чтобы проверить, успешно ли прошла установка, откройте командную строку. Для этого в меню Windows Пуск в строке поиска введите команду cmd и нажмите Enter. После этого откроется командное окно, в котором нужно ввести следующую команду.

Читайте также:  Как восстановить файл с карантина защитника windows 10

После чего, если отобразится информация об установленной версии java, то установка прошла успешно.

Частые проблемы:

  • «java» не является внутренней или внешней командой, исполняемой программой или пакетным файлом.

Проверьте правильность пути, прописанного в PATH. Старайтесь избегать пробелов в названии папки, в которую производите установку JDK. Если вы считае, что путь прописан правильно, то следует убедиться, что в дирpектории, которая прописана в строке PATH присутствует файл javac.exe, и что установленна была именно JDK, а не JDE,

  • не является приложением win 32

Возникает в следствии установки версии Java, не соответствующей разрядности системы (например, при установке 64 разрядной версии Java в 32-разрядную операционную систему).

  • Ошибка, призывающая проверить JAVA_HOME

Проверить, что в этой переменной хранится путь к установленной JAVA (без bin)

PATH and CLASSPATH

This section explains how to use the PATH and CLASSPATH environment variables on Microsoft Windows, Solaris, and Linux. Consult the installation instructions included with your installation of the Java Development Kit (JDK) software bundle for current information.

After installing the software, the JDK directory will have the structure shown below.

The bin directory contains both the compiler and the launcher.

Update the PATH Environment Variable (Microsoft Windows)

You can run Java applications just fine without setting the PATH environment variable. Or, you can optionally set it as a convenience.

Set the PATH environment variable if you want to be able to conveniently run the executables ( javac.exe , java.exe , javadoc.exe , and so on) from any directory without having to type the full path of the command. If you do not set the PATH variable, you need to specify the full path to the executable every time you run it, such as:

The PATH environment variable is a series of directories separated by semicolons ( ; ). Microsoft Windows looks for programs in the PATH directories in order, from left to right. You should have only one bin directory for the JDK in the path at a time (those following the first are ignored), so if one is already present, you can update that particular entry.

The following is an example of a PATH environment variable:

It is useful to set the PATH environment variable permanently so it will persist after rebooting. To make a permanent change to the PATH variable, use the System icon in the Control Panel. The precise procedure varies depending on the version of Windows:

Windows XP

  1. Select Start, select Control Panel. double click System, and select the Advanced tab.
  2. Click Environment Variables. In the section System Variables, find the PATH environment variable and select it. Click Edit. If the PATH environment variable does not exist, click New .
  3. In the Edit System Variable (or New System Variable) window, specify the value of the PATH environment variable. Click OK. Close all remaining windows by clicking OK.

Windows Vista:

  1. From the desktop, right click the My Computer icon.
  2. Choose Properties from the context menu.
  3. Click the Advanced tab (Advanced system settings link in Vista).
  4. Click Environment Variables. In the section System Variables, find the PATH environment variable and select it. Click Edit. If the PATH environment variable does not exist, click New .
  5. In the Edit System Variable (or New System Variable) window, specify the value of the PATH environment variable. Click OK. Close all remaining windows by clicking OK.
Читайте также:  Bad system config info windows server 2012

Windows 7:

  1. From the desktop, right click the Computer icon.
  2. Choose Properties from the context menu.
  3. Click the Advanced system settings link.
  4. Click Environment Variables. In the section System Variables, find the PATH environment variable and select it. Click Edit. If the PATH environment variable does not exist, click New .
  5. In the Edit System Variable (or New System Variable) window, specify the value of the PATH environment variable. Click OK. Close all remaining windows by clicking OK.

Update the PATH Variable (Solaris and Linux)

You can run the JDK just fine without setting the PATH variable, or you can optionally set it as a convenience. However, you should set the path variable if you want to be able to run the executables ( javac , java , javadoc , and so on) from any directory without having to type the full path of the command. If you do not set the PATH variable, you need to specify the full path to the executable every time you run it, such as:

To find out if the path is properly set, execute:

This will print the version of the java tool, if it can find it. If the version is old or you get the error java: Command not found, then the path is not properly set.

To set the path permanently, set the path in your startup file.

For C shell ( csh ), edit the startup file (

For bash , edit the startup file (

For ksh , the startup file is named by the environment variable, ENV . To set the path:

For sh , edit the profile file (

Then load the startup file and verify that the path is set by repeating the java command:

For C shell ( csh ):

For ksh , bash , or sh :

Checking the CLASSPATH variable (All platforms)

The CLASSPATH variable is one way to tell applications, including the JDK tools, where to look for user classes. (Classes that are part of the JRE, JDK platform, and extensions should be defined through other means, such as the bootstrap class path or the extensions directory.)

The preferred way to specify the class path is by using the -cp command line switch. This allows the CLASSPATH to be set individually for each application without affecting other applications. Setting the CLASSPATH can be tricky and should be performed with care.

The default value of the class path is «.», meaning that only the current directory is searched. Specifying either the CLASSPATH variable or the -cp command line switch overrides this value.

To check whether CLASSPATH is set on Microsoft Windows NT/2000/XP, execute the following:

On Solaris or Linux, execute the following:

If CLASSPATH is not set you will get a CLASSPATH: Undefined variable error (Solaris or Linux) or simply %CLASSPATH% (Microsoft Windows NT/2000/XP).

To modify the CLASSPATH , use the same procedure you used for the PATH variable.

Class path wildcards allow you to include an entire directory of .jar files in the class path without explicitly naming them individually. For more information, including an explanation of class path wildcards, and a detailed description on how to clean up the CLASSPATH environment variable, see the Setting the Class Path technical note.

Оцените статью