Intellij IDEA don't offer 'new Class' for creating - intellij-idea

I have Maven project and when I want to create new class, it isn't in an offer. There is only new File. Also packages aren't available but instead of them, there are directories.
What I should turn on?
Edit:
I have IDEA 12, here is screenshots from different projects.
Project 1 - correct:
Project 2 - incorrect

New/Class and New/Package actions are only available within source roots. If you have a project folder selected, or some subfolder that is not within a src root, you won't be able to create classes there

Mark your directory as Source root and your problem is solved

Wrong. IntelliJ 12 does allow you create new classes. Under File->New you'll see Java Class, Package, all the usual suspects.
I don't see what Maven has to do with this at all.

If you set mark the folder as source root, the color is turned to be blue and now you can right click the folder to add your packages.
Click the link to see the snapshot.
http://i.stack.imgur.com/CTFS0.jpg

Related

How do I make my modified Intellij 'intention' available to my colleagues?

I have modified an Intellij 'intention'. (I changed the initialization of the JUnit test class).
How do I make this available to other members of my organization? We are all working on the same Intellij 'project', but I believe that these changes are on a per-user, not per-project basis. (If there is a way to make the changes apply only to one project, I would prefer that).
File | Export Setting / File | Import Settings.
Are more robust way would be to use the Settings Repository plug-in.
Templates are stored in the %CONFIG% directory, fileTemplates subdirectory.
To export the file, you set the 'Schema:' pulldown in the upper right corner of 'Settings->Editor->File and Code Templates->Code tab' to 'Project' This will cause IDEA to create a folder PROJECT/.idea/fileTemplates/code, and put your modified file there. Details are in:
https://www.jetbrains.com/help/idea/2016.3/file-and-code-templates.html#d2040410e142

Add external libraries to my project issue

I try to add external library to my current project, but my project can't pick up the library.
I have MyLib.java file in other directory.
/Users/cat/myfile/github/JavaLib/MyLib.java
I want to my current project (/home/project/HelloWorld/HellowWorld.java) to use my MyLib.java
I'm following the steps to add Library to Intellij(15CE)
Menu->Project Structure->Libraries
click (+) symbol->select Java -> select my path(/home/lib/)
Here is the screenshot
Now that you have added your JavaLib directory to the project you should be able to use the code inside JavaLib in your code now. Intellij should offer auto-complete when you start to type the name of a JavaLib class and automatically include the import for you in your code.
The disabled Apply button you circled isn't an issue. I get that in my view too. It just means nothing has changed that needs to be applied currently.

Is It possible to change New Project creation level using WizardNewProjectCreationPage??

To create a New Project i am using WizardNewProjectCreationPage which creates a new project at root level.
Is it possible by any way to change that level.
For example there is already a root level folder in Project Explorer which contain some folders in it.Now i want when i right click on any of these folder and Add say New->Component.
On Component i have coded WizardNewProjectCreationPage,as i need the same functionality which ProjectCreationPage do .
But now i want this project should be added under the folder i right clicked and added component and so not on the root level.
No you can't do this. Eclipse projects can only be in the workspace root.
If you just want to create files and folders you can look at BasicNewFileResourceWizard, BasicNewFolderResourceWizard, WizardNewFileCreationPage and WizardNewFolderMainPage.

How to set up a multi-module project with equal hierarchy modules in IntelliJ?

I am wondering how to configure the following project layout in IntelliJ:
An Android application
A server back end feeding data to this application
Bean classes that are shared between back end and Android application
Initially, I wanted to create three modules on an equal hierarchy level. However, this does not seem to be possible with IntelliJ. I can only add new modules inside of the first module. I wonder if this is the way I am supposed to do it? Or is there a better way to do configure this project layout with IntelliJ? Do these hierarchies only represent folders?
I feel like I should make (3) a library module and add dependencies to (1) and (2). Since a module is defined as a discrete unit of functionality which you can compile, run, test and debug independently I feel like this is the right approach.
This is my first multi-module project in IntelliJ. Any explanation is appreciated!
When creating a new project you can use the Empty Project option on the first wizard step. When the project is created, add 3 modules in different folders under the Project Structure settings.
If you want to add them on a already initialized project, the trick from #CrazyCoder works, but you must not choose Empty Project, but instead Empty Module (in the Project Structure -> Modules dialog).
Then, choose the existing project.
Lastly, on the right side, the content root might be wrong. Set it to the root of your module.
Make sure the submodules are not on root level on the Project Structure -> Modules page. If they are, remove all expect the root module, delete the content root on the right, and add it again.

After adding new class file to App_Code, build action is Content instead of Compile

In VS2008, I am adding new classes to a web project.
When I right-click on App-Code -> Add -> New Item -> Class ...
The build action for the newly created item is set to content instead of compile. This seems like it would be a problem with the template. I've found several others through google who have run into this issue, but nobody seemed to have found a more permanent solution, other than "change it from content to compile after creation."
My question: Does anyone know of a fix for this, official or otherwise?
App_Code is a special folder meant for folder based projects.
This is just a hunch, but it might be that you have a project file based project, instead of a simple folder based one.