0

I'm new to Kotlin and have no useful experience in Java.

I'm using IntelliJ IDEA 2021.1.1 (Community Edition) on an M1 Mac. My code builds and runs within IntelliJ but it's a commandline tool that takes arguments so I want to test it directly from the commandline passing it different files as arguments. (I'm aware I can edit the configuration each time to pass different commandline arguments.)

There are similar questions here and here but their answers are about running a .jar file whereas it seems to me that building the code in IntelliJ emits a .class file and not a .jar file. Though there is a ./gradle/wrapper/gradle-wrapper.jar, the existing answers make no mention of wrappers.

I'm assuming the build step emits something that can be run without another step. Is that assumption wrong? Do I have to manually create a .jar file from the .class file on the command-line in order to run it because IntelliJ doesn't emit the final "executable"?

I seem to be missing some step or prior knowledge that existing answers don't address, perhaps they assume familiarity with Java?

hippietrail
  • 15,848
  • 18
  • 99
  • 158
  • After posting I found another previous question that received little attention but does have the answer: [Running a simple hello world from the console after installing IntelliJ IDEA](https://stackoverflow.com/questions/57508023/running-a-simple-hello-world-from-the-console-after-installing-intellij-idea) – hippietrail Jun 01 '21 at 04:48
  • 2
    See https://stackoverflow.com/a/29382636/2000323 about the way to do this with Gradle. – Andrey Jun 01 '21 at 08:38

0 Answers0