https://kotlinlang.org logo
Title
j

Jarek

02/21/2018, 10:04 AM
Hi! I want to write extension for firefox with kotlinjs and java. I try to open file and rename file name using java.io.File.Is it possible?
d

diesieben07

02/21/2018, 10:08 AM
You can't use Java libraries when compiling to Javascript.
a

anton.bannykh

02/21/2018, 10:08 AM
You won't be able to use java.io.File in Kotlin/JS. You will have to use proper JavaScript API: https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Working_with_files
But you are able to use java.io.File in Kotlin/JVM. You've mentioned you are going to use Java. If you are going to use it on JVM - no problem, go ahead.
j

Jarek

02/21/2018, 10:29 AM
ok thanks
g

gildor

02/21/2018, 10:42 AM