Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change project language level for all project in Intellij

I am using Intellij. It is good, but when I create a new project or import a project the default project language level set to 6 (@override in interfaces). But I want to set it 8 (Lambdas, type annotations etc). How can I do that? I have tried change the settings in "Other Settings" -> "Default Project Structure" and the set the project language level to 8, but no luck. Please someone help me. I have added a screen shoot. enter image description here

  • I am using Intellij 14.0.2
like image 782
Emdadul Sawon Avatar asked Apr 28 '15 09:04

Emdadul Sawon


People also ask

How do I change global settings in IntelliJ?

To configure project settings, select IntelliJ IDEA | Preferences on macOS or File | Settings on Windows and Linux from the main menu. Alternatively, you can press Ctrl+Alt+S to show the IDE settings. icon. Other settings are global and apply to all existing projects.

How do I change the default settings in IntelliJ?

From the main menu, select File | Manage IDE Settings | Restore Default Settings. Alternatively, press Shift twice and type Restore default settings . Click Restore and Restart.

What is project language level?

Project language level Language level defines coding assistance features that the editor provides. Language level can differ from your project SDK. For example, you can use the JDK 9 and set the language level to 8.


2 Answers

File -> Other Settings -> Default Project Structure...

You can change it in there.

(Edit: It's now called "Structure for New Projects")

like image 101
Trisha Avatar answered Oct 17 '22 20:10

Trisha


If it is a maven project, make sure that the following is set.

For example, if you want to use the Java 8 language features (-source 1.8) and also want the compiled classes to be compatible with JVM 1.8 (-target 1.8), you can either add the two following properties, which are the default property names for the plugin parameters:

<project>   [...]   <properties>     <maven.compiler.source>1.8</maven.compiler.source>     <maven.compiler.target>1.8</maven.compiler.target>   </properties>   [...] </project> 

For more details check this

like image 20
yellow Avatar answered Oct 17 '22 19:10

yellow