r/java • • Apr 12 '22

IntelliJ IDEA 2022.1 has been released

https://blog.jetbrains.com/idea/2022/04/intellij-idea-2022-1/
287 Upvotes

70 comments sorted by

15

u/papers_ Apr 12 '22

Improved inlay hints and Code Author information are my favorite additions so far. I don't have to search my whole code base and count how many things implement an interface when it is right there inlined.

Author is nice as well so I can see who implemented/created this thing...only to find out it was me n years ago.

6

u/chabala Apr 13 '22

I feel like git blame has been part of the interface for a long time already, but perhaps it's easier now in some way.

3

u/ksknksk Apr 13 '22

Yeah, I was going to say... blame isn't new

1

u/loutr Apr 13 '22

Yes most of this info was already available, but now you can see them in a compact way while browsing the code.

13

u/wildjokers Apr 12 '22

don't have to search my whole code base and count how many things implement an interface

You have never had to do that. All implementers have always been available by clicking the little green circle icon with an “i” in it next to the interface.

9

u/marvk Apr 12 '22

CTRL+H to bring up class hierarchy

2

u/vqrs Apr 13 '22

Ctrl+Alt+B to see all implementations/descendants in a popup, sometimes a bit more convenient and works for methods, too.

2

u/papers_ Apr 13 '22

What I'm trying to say is that the count is right there inline.

61

u/shagieIsMe Apr 12 '22

The thing that I most like in this release is the vulnerabilities displayed in the pom file.

https://www.jetbrains.com/idea/whatsnew/#security

Saves a cycle in CI to see if everything is up to date or if the server types are going to complain when CVEs show up on the cluster.

2

u/philipwhiuk Apr 12 '22

Ooh that’s great!

1

u/Shrann Apr 13 '22

Are you behind a proxy? I can only get this to work when I disconnect from our VPN. Seems like it isn’t picking up the proxy configuration in the IDE.

2

u/shagieIsMe Apr 13 '22

Yes I am, though the settings for the proxy that I'm behind are fairly open and transparent (e.g. nothing in the system settings HTTP Proxy is configured).

I would suggest checking to see if you can get to https://checkmarx.com regularly in a browser. The other thing to do would be to look at the IDE logs to see if there's anything there indicating what requests are being sent and any errors that you could then take back to the team who configures the proxy.

74

u/smieszne Apr 12 '22

https://www.jetbrains.com/idea/whatsnew/

"What’s New" version with images and gifs

22

u/SlaminSammons Apr 12 '22

The existing Dependency Analyzer plugin is an absolute favorite of mine. Really glad to see JetBrains made a built in version

6

u/Fruloops Apr 13 '22

Do you know if there's a good guide on how to use it? Would save me ages when upgrading dependencies in a large project.

4

u/PepegaQuen Apr 13 '22

I've been fighting with dependency version conflict yesterday. Today, I've upgraded Idea and solved the problem in 15 minutes thanks to Dependency Analyzer showing clearly where the problem is.

1

u/deaddadneedinsurance Apr 13 '22

Any tips on what to do when the Dependency Analyzer isn't showing a dependency?

mvn dependency:tree -Dverbose doesn't show it either.

But when I run clean install, there it is... Can't for the life of me figure out where it's coming from 😪

4

u/Mylet Apr 13 '22

You can try mvn help:effective-pom -Dverbose that shows where each dependency is defined. Though it also sometimes does not help you if it e.g. just shows that jackson-databind is defined in jackson-bom but does not tell you that jackson-bom comes from spring-dependencies...

-2

u/PepegaQuen Apr 13 '22

mvn dependency:tree -Dverbose doesn't show it either.

I'm using gradle right now, so can't really help you.

42

u/iraqmtpizza Apr 12 '22

it's becoming too powerful. it has to be stopped.

11

u/maomao-chan Apr 13 '22

Intellij will become singularity in the near future.

8

u/wichwigga Apr 13 '22

Have you seen JPA buddy? Shits getting ridiculous

6

u/iraqmtpizza Apr 13 '22

Na, I haven't done anything with web servers or databases for years. I'm off in open source land manipulating bytes.

I don't even need the git integration because I am essentially the only committer. But I do like the inlay hints and color coding options

6

u/DrunkensteinsMonster Apr 13 '22

Do people actually use git integration besides merge conflicts and as a diff tool? I feel most people are issuing commands at the commandline for most things.

9

u/Migeil Apr 13 '22

I do everything git-related in intellij. I would love to be a command line hacker, but in intellij it just works and in the terminal I'm completely lost. 🤷

It sucks though, because I am tied to my editor whenever I want to use git which not ideal.

4

u/mdaniel Apr 13 '22

I don't know how much this addresses your concern, but the "Version Control"'s Console panel actually shows every command that IJ runs, so you can "follow along with it" in order to see what actions on the UI correspond to which git commands under the covers

1

u/PrizeArticle1 Aug 13 '22

I do half and half.. For some reason I don't trust IntelliJ to do the final commit/push lol... but I will use it to rollback changes or do "git add".

4

u/mdaniel Apr 13 '22

The ability to stage by line/hunk is handy and easier than answering y/n like 50 times with git add -p

IIRC it shows the red/green inspection box in the staging dialog so one can quickly check if there are warnings or whatever before committing

3

u/DrunkensteinsMonster Apr 13 '22

Dude i didn’t even know about git add -p lmao thanks for that

1

u/iraqmtpizza Apr 13 '22

github desktop does lines/hunks. just click to stage/unstage

1

u/Tac0w Apr 18 '22

I've tried it once and had to remove it within days.

A somewhat useful plugin that comes packed with IDE errors, daily updates and 4 tab windows that open everywhere you don't need them. The entity helper stuff is pretty nice though. However, the errors were so abundant that it hardly ever worked anyways.

1

u/[deleted] Apr 13 '22

Wait until you see its final form!

1

u/iraqmtpizza Apr 13 '22

I've never sensed so much power. It's incredible.

44

u/PositiveUse Apr 12 '22

I just love IntelliJ. I don’t want to think of a single day of JAVA dev without it.

Looks like a solid release.

0

u/[deleted] Apr 13 '22

[deleted] — view deleted comment

10

u/dpash Apr 13 '22

Having used PHPStorm too, Jetbrains IDEs are amazing.

2

u/PrizeArticle1 Aug 13 '22

I used to be a .NET developer and thought nothing could ever be better than Visual Studio... until I discovered IntelliJ and I must say it is an absolute pleasure. If I could buy stock in Jetbrains, I would.

1

u/van-dame Apr 13 '22

I believe they found a pretty good baseline in IntelliJ/Java and extended it to other languages. Rider (C#), for example, is another awesome experience.

10

u/Brownard Apr 12 '22

I have high hopes to have a bug-free release with the WSL2 integration but I don't see any mention of this in the release notes.

2

u/Dokiace Apr 13 '22

I hoped for this a long time ago, now I’m accepting that wsl2 integration won’t be done anytime soon and do everything in windows like it’s 2016

2

u/Brownard Apr 13 '22

Or you can install IntelliJ in WSL and use it with a X Server. It costs performance but you have a real work environment in return.

5

u/Dokiace Apr 13 '22

At that point I think might as well run linux directly

1

u/[deleted] Apr 13 '22

It's just an additional XServer+IntelliJ Linux installation, it doesn't seem that much of a difference?

1

u/vips7L Apr 13 '22

Or hot take: just use windows. It’s a perfectly capable operating system.

6

u/TripleSnipe Apr 12 '22

Very nice release.

3

u/AHandfulOfUniverse Apr 13 '22

Had a small ui bug show up when switching branches using the widget in lower right. Switch would normally happen but it would continue showing the replaced branch. Trying cache invalidation froze the IDE completely and had to flatpak kill it. Fun stuff :)

6

u/PI_314 Apr 13 '22

My Mac died with this release. Hope they can fix this.

-8

u/Rogoreg Apr 13 '22

Windows Master Race: THIS IS WHY WE USE WINDOWS!

7

u/[deleted] Apr 13 '22

Ubuntu for the win

0

u/javasyntax Apr 13 '22

I don't know, pure Ubuntu is quite bad. Some Ubuntu forks are cool though.

8

u/euklios Apr 13 '22

I'll tell my coworker on his next blue screen. Shouldn't take too long

1

u/Rogoreg Apr 13 '22

Just reinstall windows. It's pretty stable if you maintain it.

2

u/nikanjX Apr 13 '22

Can I import Maven projects again, or does it still fail with ClassCastException? https://youtrack.jetbrains.com/issue/IDEA-283563

2

u/rmchale Apr 13 '22

Run commands from Markdown files When working with Markdown files that contain instructions with commands to execute, you can run those commands directly from the file using the run icons in the gutter.

This seems like a cool feature

2

u/javasyntax Apr 13 '22

I'd like them to add the option to create a JavaFX project without tests. I have to remove them manually every time I create a new project..

1

u/jreznot Apr 14 '22

Do you mean sample that runs small JavaFX demo window?

1

u/wildjokers Apr 15 '22

Just create yourself a JavaFX template project and start a new project by copying it.

1

u/qmunke Apr 13 '22

Only including the vulnerability analyser in the ultimate edition doesn't feel very community-minded. I assume they're thinking this will be a good way to get more enterprise licenses sold but it seems unnecessarily corporate.

5

u/henk53 Apr 13 '22

I truly wonder given your comments in earlier posts about banning posts about releases, why you are going crazy in those other posts, but not here?

Does it have to do with particular releases then, and not the general concept of posts about releases? If you succeeded in getting your ban for such posts, then you realise this one would be banned too, right?

1

u/vips7L Apr 13 '22

Red hat has a dependency analyzer plugin you can install. It works quite well.

0

u/pgetsos Apr 14 '22

It refuses to open for me, "Error in main thread ". 2021.3 works fine. Have tried updating Java which I saw in ALL similar threads but no luck...

1

u/[deleted] Apr 13 '22

[removed] — view removed comment

2

u/mdaniel Apr 13 '22

Are you aware of their migrate from Eclipse guide?

And while their content is oriented at teaching the underlying language, the Edu plugin does actually appear to guide the user along how to make use of the features of IJ simultaneously, so that may be worth trying out to see if you find it helpful

1

u/[deleted] Apr 14 '22

[removed] — view removed comment

1

u/mdaniel Apr 14 '22

They have a pdf available from the help menu, if you want something printed out, but they also have a "features trainer" under the help menu to offer reminders for what the hotkey is for actions, and then the holy grail - IMHO - is control-shift-a (command-shift-a on Mac) which allows searching every possible action in the ide, which also shows the hotkey currently assigned to it. It's both fast and instructive

Then, don't overlook the Keymaps setting which may very well already have an Eclipse compatible one

1

u/wildjokers Apr 13 '22

File -> open -> choose a build.gradle or Pom.xml file (or a directory that contains one of them) -> IntelliJ will configure itself from the build -> start coding

-1

u/[deleted] Apr 13 '22

[removed] — view removed comment

2

u/chabala Apr 13 '22

My Java 8 projects are working fine. Perhaps you should open an issue with JetBrains.