IntelliJ — Where is the “New Class” Button?

You have created a new project or opened an existing project…

You want to create a new Kotlin or Java class…

You right-click on a package as always…

However, there is no “New Java Class” or “New Kotlin Class” option…

Let’s Fix This

  1. Go to root package/folder of your project.
  2. Right-click on it.
  3. Select “Mark Directory as” → “Sources Root”
  4. Now, you can create a new classes as you want.
How to mark directory as “sources root” on IntelliJ

Have a great day 👋

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store