user9844958
user9844958

Reputation: 21

Opening files from folders in IntelliJ IDEA

I'm a beginning Java programmer and I had a project on my USB and I was trying to double click the source code just from the folder and not going into any software or IDEs.

However, it just opens the code in a Notepad and gives me an "Open with Visual Studio" option when I right click on the folder. There is no "Open with IntelliJ IDEA" option. Would be great if you guys could help me out.

I was also wondering how I could save projects in another folder or drive without having to go to the files program and copying and pasting into the drive I want it to be in.

Upvotes: 2

Views: 13002

Answers (4)

OneCricketeer
OneCricketeer

Reputation: 191983

However, it just opens the code on a notepad and gives me an open with visual studio option when I right click on the folder. There is no "open with Intellij idea" option

Sounds like you're on Windows and missed the option during Intellij installation to associate file types to the IDE.

In windows control center, there is file associations you can edit away from notepad or you can right click, go to properties, then change the "open with" options

Regarding opening whole folders, I don't typically go through right click menus, but if you want to edit code, you'd typically open the IDE anyway, so just open it, then open the folder as a project

For copying files, I don't quite understand the problem, but it's not going to be solved by Java or Intellij, and I don't know any easier way to copy files between directories or drives

Upvotes: 3

Rana Nadeem
Rana Nadeem

Reputation: 1225

enter image description here

Press W+R then type regedit and navigate to the displayed location. If those directories are not there then you can add them and add the value of the icon according to your software location.and then add these to command enter image description here

Upvotes: 1

CodingEra
CodingEra

Reputation: 1827

  1. Create a text file and add the following code in it:
@echo off

SET PhpStormPath=C:\Program Files\JetBrains\PhpStorm 2019.3.1\bin\phpstorm64.exe
 
echo Adding file entries
@reg add "HKEY_CLASSES_ROOT\*\shell\PhpStorm" /t REG_SZ /v "" /d "Open in PhpStorm"   /f
@reg add "HKEY_CLASSES_ROOT\*\shell\PhpStorm" /t REG_EXPAND_SZ /v "Icon" /d "%PhpStormPath%,0" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\PhpStorm\command" /t REG_SZ /v "" /d "%PhpStormPath% \"%%1\"" /f
 
echo Adding within a folder entries
@reg add "HKEY_CLASSES_ROOT\Directory\Background\shell\PhpStorm" /t REG_SZ /v "" /d "Open with PhpStorm"   /f
@reg add "HKEY_CLASSES_ROOT\Directory\Background\shell\PhpStorm" /t REG_EXPAND_SZ /v "Icon" /d "%PhpStormPath%,0" /f
@reg add "HKEY_CLASSES_ROOT\Directory\Background\shell\PhpStorm\command" /t REG_SZ /v "" /d "%PhpStormPath% \"%%V\"" /f

echo Adding folder entries
@reg add "HKEY_CLASSES_ROOT\Directory\shell\PhpStorm" /t REG_SZ /v "" /d "Open with PhpStorm"   /f
@reg add "HKEY_CLASSES_ROOT\Directory\shell\PhpStorm" /t REG_EXPAND_SZ /v "Icon" /d "%PhpStormPath%,0" /f
@reg add "HKEY_CLASSES_ROOT\Directory\shell\PhpStorm\command" /t REG_SZ /v "" /d "%PhpStormPath% \"%%1\"" /f

pause
  1. Rename the file with the extension to script.cmd or script.bat

  2. Run this file as administrator.

Upvotes: 4

sv Math Tutor
sv Math Tutor

Reputation: 96

When you 1st installed IntelliJ, you must have not checked the appropriate boxes to allow you to do those actions that you wanted. Installation Options when installing IntelliJ IDEA Community Edition

Under "Update context menu" you should check the box to Add "Open Folder as Project". This will allow you to choose your directory with all your Java files.

Under "Create Associations" you should check the box for .java. This will allow to double-click on your .java file to open IntelliJ.

Upvotes: 2

Related Questions