Generate SerialVersionUID in Intellij

In this post, we will see how to generate SerialVersionUID in Intellij.

There are multiple ways to do it. Let’s go through them.

Using find action

You can generate SerialVersionUID in intellij by pressing ctrl + shift +A(find action) and then typing Serializable class without serialVersionUID and toggle it from Off to On.

💻 Awesome Tech Resources:
  • Looking for ⚒️ tech jobs? Go to our job portal.
  • Looking for tech events? Go to tech events 🗓️ Calendar.️
Generate SerialVersionUID using Action

Now create a class SerializableExample and it will implement Serializable
interface and generate serialVersionUID as below:

Generate SerialVersionUID in Class

Using Settings window

Navigate through following path:
File -> Settings -> Editor -> Inspections -> Java -> Serialization issues

and find Serializable class without serialVersionUID and check it.

generate serialVersionUID from Settings

Now create a class SerializableExample and it will implement Serializable interface and generate serialVersionUID as below:

Using Randomly Change serialVersionUID Initializer

You can also press Alt +  Enter on following statement:

Put the cursor after = and press Alt + Enter to generate serialVersionUID in Intellij.

Generate serialVersionUID using variable

Using GenerateSerialVersionUID plugin

You can install GenerateSerialVersionUID plugin from the link.

Once you install this plugin, you can Right click -> Generate -> SerialVersionUID to generate SerialVersionUID in Intellij.

That’s all about how to generate SerialVersionUID in intellij.

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *

Subscribe to our newletter

Get quality tutorials to your inbox. Subscribe now.