Как поменять версию jdk в intellij idea
Перейти к содержимому

Как поменять версию jdk в intellij idea

  • автор:

Русские Блоги

1. Настройте JDK перед созданием нового проекта.

Откройте инструмент интегрированной среды разработки IDEA, щелкните: Файл — Структура проекта, как показано ниже.

На открывшейся странице выберите свойства SDK и щелкните значок плюса + посередине, чтобы выбрать JDK, как показано ниже.

На открывшейся странице выберите каталог JDK, который был установлен на локальном компьютере (выберите верхний уровень каталога bin), а затем нажмите кнопку ОК, как показано ниже.

Затем в окне «Структура проекта» по очереди нажмите кнопку «Применить» — «ОК», как показано ниже.

Затем создайте проект в инструменте, выберите в раскрывающемся списке соответствующую версию JDK, как показано ниже.

2. Настройте JDK в новом проекте.

Откройте инструмент интегрированной среды разработки IDEA, щелкните: File — New — Project, как показано ниже.

В открывшемся окне нажмите кнопку New, затем выберите соответствующую версию JDK, нажмите кнопку OK, а затем Next, чтобы создать проект и использовать настроенный JDK, как показано ниже.

В-третьих, переключите JDK проекта

Откройте инструмент интегрированной среды разработки IDEA, щелкните: Файл — Структура проекта, как показано ниже.

В открывшемся окне выберите Project, а затем на странице сведений нажмите кнопку New и щелкните параметр JDK, как показано ниже.

Затем выберите соответствующую версию JDK, нажмите кнопку ОК, как показано ниже.

В-четвертых, настройте JDK на стартовой странице.

На стартовой странице IDEA разверните меню «Настроить» и выберите «Параметры проекта по умолчанию — Структура проекта», как показано ниже.

В открывшемся окне нажмите кнопку New и выберите JDK, как показано ниже.

Затем выберите соответствующую версию JDK, нажмите кнопку ОК, как показано ниже.

How do I change the IntelliJ IDEA default JDK?

I use IntelliJ IDEA as my development environment, and Maven for dependency management. I frequently build my project structure (directories, poms, etc) outside of IDEA and then import the project into IDEA using Import project from external model . This works great, except that in my poms I specify that the maven-compiler-plugin should use JDK 1.6, and when I import, IDEA informs me that the Language Level Changed and that Language level changes will take effect on project reload , and then prompts to reload the project. This is annoying because I always use the same JDK version.

How do I change the default JDK that IntelliJ IDEA uses, so that I don’t have to reload my project every time I import a new project?

11 Answers 11

This setting is changed in the "Structure for New Projects" dialog. Navigate to "File" -> "New Projects Setup" -> "Structure. "

Selecting Structure For New Projects

Next, modify the "Project SDK" and "Project Language Level" as appropriate.

Selecting Project Language Level

Previous versions of IntelliJ IDEA had this setting in "File" -> "Other Settings" -> "Default Project Structure. ".

IntelliJ IDEA 12 had this setting in "Template Project Structure. " instead of "Default Project Structure. "

How to change java version in intellij

In this post, we will see how to change java version in intellij.

Steps to change java version in intellij IDEA

Here are steps to change java version in Intellij
idea.

  1. Go to File -> Project Structure

If you prefer keyboard shortcuts:

  • Windows : Ctrl + Shift + Alt + S
  • Mac : CMD + ;

Following pop up will be displayed in intellij.

Project Structure

  1. Navigate to Project Setting -> SDK and add JDK.

Add JDK

If you have already configured JDK, then select the JDK.

ChangeProjectSDK

Once you change the JDK version, project will start reindexing its source files and libraries to ensure all JDK features are in sync.

Change module SDK

💡 Did you know?

Please note that when you change java version in intellij, it will only be used by intellij. If you run the java program via command line, then it will use JAVA_HOME java version.

It won’t also change JVM used by build tools such as maven or gradle.

Как поменять версию jdk в intellij idea

Completing the CAPTCHA proves you are a human and gives you temporary access to the web property.

What can I do to prevent this in the future?

If you are on a personal connection, like at home, you can run an anti-virus scan on your device to make sure it is not infected with malware.

If you are at an office or shared network, you can ask the network administrator to run a scan across the network looking for misconfigured or infected devices.

Another way to prevent getting this page in the future is to use Privacy Pass. You may need to download version 2.0 now from the Chrome Web Store.

Cloudflare Ray ID: 71aabeb228d99b3d • Your IP : 82.102.23.104 • Performance & security by Cloudflare

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *