Warning when using JLine and failing test cases

i had maven problem so i installed JLine via jar files.
So when i tried pushing the code it is showing this error.
Can someone help me figure out what is this.
I asked GPT also it said to make changes in pom.xml files, i tried but still making error

Here is Github repo : GitHub - Molik2801/codecrafters-shell-java

I don’t know how Java runs in the tester or on your machine, but the Warnings emitted by your program due to the library is unexpected output for the tester. So as the suggestion says, you may have to run it with --enable-native-access=ALL-UNNAMED to remove the warning.

ya i added this in plugin in pom.xml but it didnt worked then.
So after few more GPT prompt lol i found out that Codecrafter is using java 17 version and i was using 23 . this was causing the problem. i dont know why.
now test are running but failing on some cases. will try to figure out them now.
Thanks

Hey @Molik2801, you can fix this by adding the --enable-native-access=ALL-UNNAMED flag to the Java command in .codecrafters/run.sh .

Give that a try and let me know if it fixes the warning or if you’re still running into issues.

@Molik2801 BTW, our test runner uses Java 25 to run your shell.

ya my issue was solved when i added that –enable-native line in pom.xml
but for that to work i have to change the java version from 25 to 17.

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.