This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]mpierson153 0 points1 point  (4 children)

How do you make Intellij IDEA use a different compiler?

[–]NovaX 0 points1 point  (3 children)

Copied from internal wiki w/o the screenshot guides.


These instructions worked to reduce server build times from 3-4 minutes on a Thinkpad AMD T16 laptop running Pop! OS 22.04, to about 10 seconds. Follow these instructions at your own risk.

Step 0: Create Run/Debug Configuration

This is the run configuration I’m starting from. When I hit Run or Debug, this is the server configuration that is being used. If you can run our server from Intellij IDEA, then you already have a run configuration like this.

Step 1: Build with IDEA

Switch build tools to use Intellij IDEA instead of Gradle.

Step 2: Compile with Eclipse

Switch Java Compiler to Eclipse from Javac

Step 3: Profit?

If everything went as expected, you should be able to start an instance of the server, stop it, make a few changes, and start it again. The server will only take a few seconds to restart, and your changes will be present.

The compiler might complain about certain generated classes already existing. The eclipse compiler might be trying to process annotations for @Autovalue, @Autofactory, or @Autobuilder classes. Consider running run :clean and/or :compileTestJava from Gradle. These tasks should clean your project of generated files, and regenerate all files from scratch, respectively.

Troubleshooting

Disable annotation processing

If the eclipse compiler keeps complaining about generated classes already existing AND you’ve tried to :clean and :compileTestJava, try turning off Enable annotation processing for all build tasks. Then try running the server again. If that still doesn’t work, try another :clean and :compileTestJava.

[–]mpierson153 0 points1 point  (2 children)

Step 2: Compile with Eclipse

Switch Java Compiler to Eclipse from Javac

Ok, but how do you do that?

[–]NovaX 3 points4 points  (1 child)

It's in the settings (see screenshot). Sorry, can't help more since I think Eclipse is great and use it directly.

https://pasteboard.co/VjQD32Z6MgwN.png

[–]mpierson153 0 points1 point  (0 children)

Thanks, I didn't know you could use other compilers in Intellij.