fcosta
03/04/2020, 9:28 PM$ ./jvm/main-kts/scripts/kotlin-shell.main.kts
:: problems summary ::
:::: WARNINGS
module not found: eu.jrie.jetbrains#kotlin-shell-core;0.2.1
==== central: tried
<https://repo1.maven.org/maven2/eu/jrie/jetbrains/kotlin-shell-core/0.2.1/kotlin-shell-core-0.2.1.pom>
-- artifact eu.jrie.jetbrains#kotlin-shell-core;0.2.1!kotlin-shell-core.jar:
<https://repo1.maven.org/maven2/eu/jrie/jetbrains/kotlin-shell-core/0.2.1/kotlin-shell-core-0.2.1.jar>
error: cannot access script base class 'org.jetbrains.kotlin.mainKts.MainKtsScript'. Check your module classpath for missing or conflicting dependencies (kotlin-shell.main.kts:3:1)
error: unresolved reference: Repository (kotlin-shell.main.kts:3:7)
error: unresolved reference: DependsOn (kotlin-shell.main.kts:4:7)
error: unresolved reference: DependsOn (kotlin-shell.main.kts:5:7)
error: unresolved reference: CompilerOptions (kotlin-shell.main.kts:6:7)
error: unresolved reference: kotlinx (kotlin-shell.main.kts:7:13)
error: an annotation argument must be a compile-time constant (kotlin-shell.main.kts:7:13)
error: unresolved reference: eu (kotlin-shell.main.kts:9:8)
error: unresolved reference: shell (kotlin-shell.main.kts:11:1)
error: unresolved reference: args (kotlin-shell.main.kts:12:9)
error: expression '"ls -l"' of type 'String' cannot be invoked as a function. The function 'invoke()' is not found (kotlin-shell.main.kts:13:9)
error: unresolved reference: pipeline (kotlin-shell.main.kts:21:9)
error: unresolved reference: args (kotlin-shell.main.kts:22:20)
error: unresolved reference: process (kotlin-shell.main.kts:22:30)
error: unresolved reference: streamLambda (kotlin-shell.main.kts:23:21)
error: cannot infer a type for this parameter. Please specify it explicitly. (kotlin-shell.main.kts:23:36)
error: cannot infer a type for this parameter. Please specify it explicitly. (kotlin-shell.main.kts:23:42)
error: cannot infer a type for this parameter. Please specify it explicitly. (kotlin-shell.main.kts:23:45)
error: expression '"wc ${args[0]}"' of type 'String' cannot be invoked as a function. The function 'invoke()' is not found (kotlin-shell.main.kts:44:9)
error: unresolved reference: args (kotlin-shell.main.kts:44:15)
jvm/main-kts/scripts/kotlin-shell.main.kts: error: unresolved dependency: eu.jrie.jetbrains#kotlin-shell-core;0.2.1: not found
jvm/main-kts/scripts/kotlin-shell.main.kts:3:1: error: cannot access script base class 'org.jetbrains.kotlin.mainKts.MainKtsScript'. Check your module classpath for missing or conflicting dependencies
@file:Repository("<https://dl.bintray.com/jakubriegel/kotlin-shell>")
^
jvm/main-kts/scripts/kotlin-shell.main.kts:3:7: error: unresolved reference: Repository
@file:Repository("<https://dl.bintray.com/jakubriegel/kotlin-shell>")
^
jvm/main-kts/scripts/kotlin-shell.main.kts:4:7: error: unresolved reference: DependsOn
@file:DependsOn("eu.jrie.jetbrains:kotlin-shell-core:0.2.1")
^
jvm/main-kts/scripts/kotlin-shell.main.kts:5:7: error: unresolved reference: DependsOn
@file:DependsOn("org.slf4j:slf4j-simple:1.7.28")
^
jvm/main-kts/scripts/kotlin-shell.main.kts:6:7: error: unresolved reference: CompilerOptions
@file:CompilerOptions("-Xopt-in=kotlin.RequiresOptIn")
^
jvm/main-kts/scripts/kotlin-shell.main.kts:7:13: error: unresolved reference: kotlinx
@file:OptIn(kotlinx.coroutines.ExperimentalCoroutinesApi::class)
^
jvm/main-kts/scripts/kotlin-shell.main.kts:7:13: error: an annotation argument must be a compile-time constant
@file:OptIn(kotlinx.coroutines.ExperimentalCoroutinesApi::class)
^
jvm/main-kts/scripts/kotlin-shell.main.kts:9:8: error: unresolved reference: eu
import eu.jrie.jetbrains.kotlinshell.shell.*
^
jvm/main-kts/scripts/kotlin-shell.main.kts:11:1: error: unresolved reference: shell
shell {
^
jvm/main-kts/scripts/kotlin-shell.main.kts:12:9: error: unresolved reference: args
if (args.isEmpty()) {
^
jvm/main-kts/scripts/kotlin-shell.main.kts:13:9: error: expression '"ls -l"' of type 'String' cannot be invoked as a function. The function 'invoke()' is not found
"ls -l"()
^
jvm/main-kts/scripts/kotlin-shell.main.kts:21:9: error: unresolved reference: pipeline
pipeline {
^
jvm/main-kts/scripts/kotlin-shell.main.kts:22:20: error: unresolved reference: args
"cat ${args[0]}".process() pipe
^
jvm/main-kts/scripts/kotlin-shell.main.kts:22:30: error: unresolved reference: process
"cat ${args[0]}".process() pipe
^
jvm/main-kts/scripts/kotlin-shell.main.kts:23:21: error: unresolved reference: streamLambda
streamLambda { strm, _, _ ->
^
jvm/main-kts/scripts/kotlin-shell.main.kts:23:36: error: cannot infer a type for this parameter. Please specify it explicitly.
streamLambda { strm, _, _ ->
^
jvm/main-kts/scripts/kotlin-shell.main.kts:23:42: error: cannot infer a type for this parameter. Please specify it explicitly.
streamLambda { strm, _, _ ->
^
jvm/main-kts/scripts/kotlin-shell.main.kts:23:45: error: cannot infer a type for this parameter. Please specify it explicitly.
streamLambda { strm, _, _ ->
^
jvm/main-kts/scripts/kotlin-shell.main.kts:44:9: error: expression '"wc ${args[0]}"' of type 'String' cannot be invoked as a function. The function 'invoke()' is not found
"wc ${args[0]}"()
^
jvm/main-kts/scripts/kotlin-shell.main.kts:44:15: error: unresolved reference: args
"wc ${args[0]}"()
^
fcosta
03/05/2020, 6:14 PMmbonnin
03/05/2020, 6:42 PMmbonnin
03/05/2020, 6:42 PMenv kotlin
say?fcosta
03/05/2020, 6:57 PM$ env kotlin
Welcome to Kotlin version 1.3.70 (JRE 1.8.0_232-b09)
Type :help for help, :quit for quit
>>>
ilya.chernikov
03/12/2020, 2:37 PMerror: cannot access script base class 'org.jetbrains.kotlin.mainKts.MainKtsScript'
That means that you have an atypical installation, and kotlin compiler is not able to find kotlin-main-kts.jar
, and interprets all scripts as a default ones.
How is the kotlin compiler installed in your system?
And can you have a look at the folder where kotlin-compiler.jar
is located?fcosta
03/15/2020, 2:05 AMJaxon Du
03/15/2020, 8:06 PMJaxon Du
03/15/2020, 8:43 PMilya.chernikov
03/16/2020, 9:15 AMJaxon Du
03/16/2020, 7:15 PMKOTLIN_MAIN_KTS_COMPILED_SCRIPTS_CACHE_DIR does not work. I'm on latest macOS.