1

I used the shortcut Alt+Enter to get problem solutions for specific errors or context. For example:

package test;

import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
    public static void main(String[] args) {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        String line = reader.readLine();
    }
}

and Alt+Enter was supposed to change

public static void main(String[] args) 

to

public static void main(String[] args) throws IOException

and import java.io.InputStreamReader;.

If I make the following code:

int sizeA = 5;
int sizeB = 50;
int area = calculateArea(sizeA,sizeB);

Alt+Enter was supposed to make a Method for me where I make the calculations.

Now I have a fresh installation of IntelliJ Community Edition, using JDK 9 and the shortcut doesn't work anymore. All Alt+Enter does is call the "Generate" tab where I can generate methods like toString() or hashCode() or constructors.

Any solutions?

Javaru
  • 30,412
  • 11
  • 93
  • 70
Fluch
  • 323
  • 3
  • 8
  • use `ctrl` + `space` at the location of yor problem – Lino Nov 13 '17 at 13:29
  • 1
    Check your Keymap setting for "Other > Show Intention Actions". Looks like you currently have a different shortcut for that. – Tom Nov 13 '17 at 13:39
  • Hello Tom, Ctrl+Alt+S brings that menu, then I have Keymap and for Other>Show Intention Actions it is set as "Alt+Enter. Problem is still present :/ – Fluch Nov 13 '17 at 13:45
  • Do you use a different keymap profile (the select box in the Keymap settings)? Have you tried to select a different one? Also have you checked the suggested duplicate question _and it's answer_? – Tom Nov 13 '17 at 13:51
  • Hello Tom, according to that question as I can understand it some other application was overwriting the command and the author had to stop Facebook in order for him to work. I did find that thread before I posted mine and I tried to stop all applications. I even rebooted now and started only IntelliJ and the issue was still present. Alt+Enter only brings "Generate" tab. As for the kemap - I am using the Default one - here is a screenshot -> https://imgur.com/a/73Ccy This is a brand new installation of Windows and IntelliJ. I have not imported anything or used any themes. – Fluch Nov 13 '17 at 14:01
  • You can try to select a different profile, check it's setting for that shortcut and if that works and then revert back to default. – Tom Nov 13 '17 at 14:04
  • It does not work. I tried all of the options Default for Gnome/KDA/Mac./JB etc... I think I will just reinstall IntelliJ at that point :/ – Fluch Nov 13 '17 at 14:08
  • Even Reinstalling did not help. – Fluch Nov 13 '17 at 14:21
  • 2
    I think you actually want to check the mapping for "Generate" and not "Show Intention Actions" since it sounds like "Generate" is overriding "Show Intention Actions". Sounds like maybe Generate got set to `Alt+Enter` (should be `Alt+Insert` by default). A reinstall would not clear old settings. You can try closing IDEA, then go to `C:\Users\UserName\.IdeaIC2017\config\keymaps.` Remove (and backup somewhere just in case) *all* the keymap XML files (including "Default" if present since this is the overriding of default) and then restart IDEA. – Javaru Nov 13 '17 at 15:21
  • Hello Javaru, Most probably that was the case. Something had overwritten the Alt+Insert. Considering I had a fresh Windows on USB and I had just installed on the new SSD I gave up and spent an hour and something and reinstalled Windows completely. Now everything works fine. I believe that the problem was with overwriting the Alt+Insert. I really wanted to fix this issue but I was weak and I gave up and went the monkey way of reinstalling Windows. I hope the problem does not occur ever again. – Fluch Nov 13 '17 at 20:29
  • 1
    @Fluch Even if it does occur again, you now know where to look to fix it. – Tom Nov 14 '17 at 09:23

0 Answers0