I had a coupon code for JetBrains Junie AI Ultimate for a year. I set it up last month and have been using it a good bit.
How setup went
First I installed the Junie plugin. After accepting the license, I went to:
help > register – click disabled paid plugins > click JetBrains AI Assistant > Enable and restart
Then I clicked the three dots and license info which took me to the website. I had to click buy on AI ultimate and enter the code. I’m guessing I could have started on that page.
My first test
As a simple use case, I asked JUnie to create a package with two examples. Junie gave me a plan and the two examples:
Create com.jeanneboyarsky.scoped
package with immutability examples.
Explore repository to confirm coding style and package naming conventions.
- Create new package directory src/com/jeanneboyarsky/scoped with two classes:
- Ensure examples are self-contained with main methods printing illustrative output.
- Note compilation requirements: document that JDK 21 needs –enable-preview, while JDK 22+ compiles normally.
- Provide summary and submit changes.
then listed summary for each class
A new Java class has been created to demonstrate that ScopedValue bindings are immutable within their scope. The implementation highlights that reassignment attempts are not permitted due to ScopedValue being a preview API.
A new Java file has been created to demonstrate that while a ScopedValue’s binding is immutable, the underlying object can be mutable. The code successfully illustrates mutating a Map within scoped values, while also handling scope boundaries.
Finally listed two two classes it created with a link to rollback if i don’t like
A new package com.jeanneboyarsky.scoped
was created with two classes: ScopedImmutable1
demonstrates the immutability of ScopedValue bindings, and ScopedMapMutable1
shows that the contents of a mutable Map inside a ScopedValue can be changed. The code compiles for JDK 21+ but lacks automated tests.
In PyCharm
The license is good for all JetBrains products so I tried it in PyCharm as well.
Create a file named junie.py that plays tic tac toe. However instead of X and O, use Unicode symbols for unicorn and wolf. Also have the computer player use a strategy with a low win rate.
The generated code was concise and clear. It used Python idioms. It was well commented. Junie decided to implement my request for a low win rate with this strategy:
# Strategy intentionally weak:
# 1) 60% of the time: choose random move outright.
# 2) 40% of the time: attempt some light heuristics but also sometimes skip blocks/wins.
# Light heuristics section (still weak)
# a) occasionally avoid taking a direct win to stay weak
# b) occasionally block human, but not always
# c) mild preference for center, but not strong
# d) otherwise random corner or side
I ran the code and it works. And won’t frustrate a small child.
Generating Docs
I’m presenting an updated version of “Java Does What Now.” I created an IntelliJ project with packages for each of the examples in my presentation. After I was done, I asked Junie to create a readme to document the unexpected behaviors exhibited by the code.
It didn’t always get it right, for example telling me the module import was invalid. But that’s a new feature so not one it’s been trained on. But overall it did a good job.