- Module structure settings
- Module SDK
- Set up a module SDK
- How does IntelliJ IDEA know which JDK to use?
- Module language level
- Configure module language level
- Module compiler output
- Configure module compiler output
- Module libraries
- Add module-level libraries
- How to add a project to build path in IntelliJ Idea
- How to add a project to build path in IntelliJ Idea
- How to add libraries to build path in intellij
- How to add jars to build path in IntelliJ
- How do I re-include a class into the build path in Intellij IDEA?
- Path in Intellij Vs. Eclipse
- How to set spring library path in intelliJ idea
- How to set the java.library.path in intelliJ Idea
- Related videos on Youtube
- AKIWEB
- Comments
Module structure settings
Module settings apply only to one module and are stored in the .iml file. A module can have an SDK and a language level that are different from those configured for a project, and their own libraries. They can also carry a specific technology or a framework.
Module SDK
An SDK is a collection of tools that you need to develop an application for a specific software framework. To develop Java-based applications, you need a JDK (Java Development Kit).
You can compile a module with an SDK that differs from the project SDK.
Set up a module SDK
- From the main menu, select File | Project Structure | Project Settings | Modules .
- Select the module for which you want to set an SDK and click Dependencies .
- If the necessary SDK is already defined in IntelliJ IDEA, select it from the Module SDK list. If the SDK is installed on your computer, but not defined in the IDE, select Add SDK | ‘SDK name’ , and specify the path to the SDK home directory. Only for JDKs: If you don’t have the necessary JDK on your computer, select Add SDK | Download JDK . In the next dialog, specify the JDK vendor, version, change the installation path if required, and click Download .
If you want a module to inherit a project SDK, select the Project SDK option from the Module SDK list.
How does IntelliJ IDEA know which JDK to use?
IntelliJ IDEA does the following to determine which JDK to use for compilation if you use different JDKs for modules in your project.
- It checks all JDKs that are used in the project: the JDKs that are defined on both the project and module levels.
- It calculates the latest of these JDKs. This is necessary to make sure all modules can be compiled.
- If the version of the latest JDK configured is lower than 1.6, IntelliJ IDEA will pick the JDK version that is used for running the IDE. This limitation is related to the fact that the compiler API used by IntelliJ IDEA for building projects is supported starting from JDK 1.6.
- Although a specific version of the compiler will be used (in accordance with the selected JDK version), each separate module will be compiled using the javac’s cross-compilation feature against the libraries of the JDK defined for this particular module in the project settings. This protects you from a situation when a module is compiled against newer libraries than those for which dependencies are set.
Module language level
Language level defines coding assistance features that the editor provides. To configure a language level for a module:
Configure module language level
- From the main menu, select File | Project Structure Ctrl+Alt+Shift+S .
- Under Project Settings , select Modules | Sources .
- From the Language level list, select the necessary option.
- To use the project language level, select Project default .
Module compiler output
Compiler output path is the path to the directory in which IntelliJ IDEA stores the compilation results. In this directory, the IDE creates two sub-directories: output for production code and test output for test sources.
Configure module compiler output
- From the main menu, select File | Project Structure Ctrl+Alt+Shift+S .
- Under Project Settings , select Modules | Paths .
- Change the paths specified in the Output path and Test output path or select Inherit project compile output path to use the paths specified for the project.
- Select the Exclude output path checkbox to exclude the output folders from code completion, navigation, and inspections. This helps increase overall IDE performance.
Module libraries
Libraries are a collection of compiled code that you can use when developing applications. You can add libraries on the module level. In this case, only one module can use the code from such libraries.
Add module-level libraries
Global and project libraries are not available until you add them to module dependencies.
- From the main menu, select File | Project Structure | Project Settings | Modules .
- Select the module for which you want to add a library and click Dependencies .
- Click the button and select Library .
- In the dialog that opens, select a project or a global library that you want to add to the module. Alternatively, click New Library and select how do you want to add a new library: you can add a Java and Kotlin libraries from files on your computer, or download a library from Maven.
How to add a project to build path in IntelliJ Idea
Then go to your current project File > project structure > Module > (Select your current project) Under Dependencies Check mark your project (now a module) you want to import and then click apply and then OK. Anyway if you are not using maven all you have to do is go to Project structure ( ctrl + alt + shift + s ) — Modules — go to your module — mark the folder that your want to add as resource Question: I am new to javeEE and spring.
How to add a project to build path in IntelliJ Idea
I’ve recently converted over to IntelliJ Idea 13, previously in eclipse I was able to add a project to another project’s build path. I’m not able to accomplish this in IntelliJ.
How can I add project1 to project2’s build path so that I can use it as a dependency. I don’t want to make that project a JAR because I’m still developing it.
I was not able to successfully achieve my goal.
I see the project I’d like to add to my build path (DataProvider) but it’s highlighted red, and the bottom warning text states «Invalid item ‘DataProvider’ in dependencies list’
Any help or assistance would be much appreciated.
Solution (Thanks @leeor)
Import project as a module
This will add that project to the project view pane on the left side of the screen.
File > project structure > Module > (Select your current project)
Check mark your project (now a module) you want to import and then click apply and then OK.
Using IntelliJ Idea 13.1.6 on Mac
If you want to depend on another module without it being jar, you need to import that as a module into the same project. It doesn’t look like DataProvider is imported since it doesn’t appear in the module list.
Java — Setting up JUnit with IntelliJ IDEA, Create and setup a «tests» folder. In the Project sidebar on the left, right-click your project and do New > Directory. Name it «test» or whatever you like. Right-click the folder and choose «Mark Directory As > Test Source Root». Adding JUnit library. Right-click your project and choose «Open Module Settings» or hit F4.
How to add libraries to build path in intellij
How to add jars to build path in IntelliJ
How do I re-include a class into the build path in Intellij IDEA?
I accidentally excluded a class from the build path, from the compiler errors pane, and I can’t figure out how to get it back.
The class isn’t visible from any other classes, and it was right before I clicked that fateful menu option.
The class has a little «x» on the icon, whereas none of my other classes do.
EDIT: Figured it out myself. Go to Settings>Project Settings>Compiler>Excludes and delete the entry
Go to Settings -> Project Settings -> Compiler -> Excludes and delete the entry
2018 update
File -> Settings -> Build, Execution, Deployment -> Compiler -> Excludes
How to add directory to classpath in an application run, Talent Build your employer brand In Intellij 13, it looks it’s slightly different again. Here are the instructions for Intellij 13: click on the Project view or unhide it by clicking on the «1: Project» button on the left border of the window or by pressing Alt + 1; find your project or sub-module and click on it to highlight it, then press F4, or …
Path in Intellij Vs. Eclipse
My company is attempting to make a transition from Eclipse to Intellij Idea and I have a (might be silly) question regarding the paths.
I have a library in the root of the eclipse project and a spring configuration file which simply points to it by «folderName/file.txt». It works fine in Eclipse since it recognizes the folder. In IntelliJ however it seems to not pick the folder at all.
I’ve tried to mark the folder as a resource/test resource folder but it seems to simply take the contents of the folder and dump it directly into the target folder without the folder itself, just the contents.
Is there a way to configure IntelliJ to work with the folder just like in Eclipse? This is important because some are still using Eclipse, some IntelliJ, so we need a solution that will work for both.
I am guessing your are using maven since you mention the «target folder»
What happens is that since your imported the project from the maven pom.xml intellij build it by following maven. In maven the default Project structure is this
This in maven everything you copy in the resources folder, will be copied to your root classpath. so if you make for resources/myFolder/my.txt then in the build you will have copied to your classpath myFolder/my.txt Anyway if you are not using maven all you have to do is go to
Project structure ( ctrl + alt + shift + s ) — Modules — go to your module — mark the folder that your want to add as resource
In intellij can one set the «path» environment variable, To refine this I spawn an ant task that builds native DLLs and puts them in a «artifact» area relative to the project output directory. So I want to set the path variable for the debug process to contain the path to the DLLs so the java code can load them and do so properly wherever the project folder might lie on any …
How to set spring library path in intelliJ idea
I am new to javeEE and spring. I have downloaded the spring libraries, apache common loggings api and apache tomcat.
I would like to set up a spring mvc framework project in intelliJ. I have the libraries, but intelliJ downloads them again every time I start a new project. I select libraries that it downloads, but now avail, it downloads the same libraries, plus adds my libraries into the » external libraries » tab in project structure.
I have set the CLASSPATH to the location of libraries by editing the ~/.bashrc but still doesn’t load the libraries.
How can I set the default spring framework library path for the intelliJ? I am using ubuntu 14.04 and Java version 1.8
Just look for apache ivy , and a plugin for idea. With this you add any jar you want to your classpath
How do I re-include a class into the build path in Intellij, 2 Answers. Go to Settings -> Project Settings -> Compiler -> Excludes and delete the entry. Settings is under the File Menu. You can also navigate using the CTRL-SHIFT-A and type in «setting». This worked for me. Just needed to get to the location to remove the class for the excludes.
How to set the java.library.path in intelliJ Idea
If you run your program from IntelliJ then you can set the java.library.path in the VM options input field in the Run/Debug Configurations dialog.
Related videos on Youtube
AKIWEB
Comments
Native code library failed to load. java.lang.UnsatisfiedLinkError: no ts-jni in java.library.path
I am using IDEA IDE as a first time, and have been using Resin_4.0.37 as a server to test my work. As soon as I start my lcoal server in debug mode it stays for approximately 1-2 mins and then suddenly it drops down and get disconnected by giving me the above error. I have set my Windows environmental variable correctly; and have also did the following in my IDE intelliJ:
FILE->Project Structure->set Global Libraries->a. Java path and b. Resin library path.
Can any one please suggest me, what am I doing wrong and how do I set native library in intelliJ IDEA to solve the mentioned error. Any help would be appreciated. Also do correct me if I am doing something wrong. Thanks!
@SriHarshaChilakapati, you can edit ‘Defaults->Application->VM Options’ to get what you want. After defining desired VM option in Defaults, every new run in the project will be created with that VM option.
what should we do If we need more than one library? -Djava.library.path=»C:\qtjambi-4.8.6\lib,C:\qtjambi-4.8.6\bin» is legal?