Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SBT 1.3.9 is not working on Windows 10 #5495

Closed
pablo53 opened this issue Apr 4, 2020 · 3 comments
Closed

SBT 1.3.9 is not working on Windows 10 #5495

pablo53 opened this issue Apr 4, 2020 · 3 comments
Labels
area/windows Windows-specific issue Bug needs info Needs more information to take further actions.

Comments

@pablo53
Copy link

pablo53 commented Apr 4, 2020

steps

  1. Install openjdk java 1.8 (zulu)
  2. Install sbt-1.3.9.msi
  3. Try to create a new project with "sbt new" command, and
    it gives the following error error:
    C:\Users\XXXXXX\Documents\projects\testplay>sbt new

problem

[ERROR] Terminal initialization failed; falling back to unsupported
java.lang.NoClassDefFoundError: Could not initialize class org.fusesource.jansi.internal.Kernel32
        at org.fusesource.jansi.internal.WindowsSupport.getConsoleMode(WindowsSupport.java:50)
        at jline.WindowsTerminal.getConsoleMode(WindowsTerminal.java:211)
        at jline.WindowsTerminal.init(WindowsTerminal.java:81)
        at jline.TerminalFactory.create(TerminalFactory.java:116)
        at jline.TerminalFactory.get(TerminalFactory.java:180)
        at jline.TerminalFactory.get(TerminalFactory.java:186)
        at sbt.internal.util.ConsoleAppender$.usingTerminal(ConsoleAppender.scala:306)
        at sbt.internal.util.ConsoleAppender$.ansiSupported(ConsoleAppender.scala:294)
        at sbt.internal.util.ConsoleAppender$.useColorDefault$1(ConsoleAppender.scala:129)
        at sbt.internal.util.ConsoleAppender$.$anonfun$formatEnabledInEnv$4(ConsoleAppender.scala:145)
        at scala.runtime.java8.JFunction0$mcZ$sp.apply(JFunction0$mcZ$sp.java:23)
        at scala.Option.getOrElse(Option.scala:189)
        at sbt.internal.util.ConsoleAppender$.<init>(ConsoleAppender.scala:145)
        at sbt.internal.util.ConsoleAppender$.<clinit>(ConsoleAppender.scala)
        at sbt.internal.util.GlobalLogging$.initial(GlobalLogging.scala:83)
        at sbt.StandardMain$.initialGlobalLogging(Main.scala:149)
        at sbt.StandardMain$.initialState(Main.scala:175)
        at sbt.xMain$.run(Main.scala:65)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at sbt.internal.XMainConfiguration.run(XMainConfiguration.scala:45)
        at sbt.xMain.run(Main.scala:39)
        at xsbt.boot.Launch$$anonfun$run$1.apply(Launch.scala:111)
        at xsbt.boot.Launch$.withContextLoader(Launch.scala:130)
        at xsbt.boot.Launch$.run(Launch.scala:111)
        at xsbt.boot.Launch$$anonfun$apply$1.apply(Launch.scala:37)
        at xsbt.boot.Launch$.launch(Launch.scala:119)
        at xsbt.boot.Launch$.apply(Launch.scala:20)
        at xsbt.boot.Boot$.runImpl(Boot.scala:56)
        at xsbt.boot.Boot$.main(Boot.scala:18)
        at xsbt.boot.Boot.main(Boot.scala)

java.lang.UnsatisfiedLinkError: C:\Users\XXXXXX\AppData\Local\Temp\jna-1267368576\jna3471279410491450454.dll: Can't find dependent libraries
        at java.lang.ClassLoader$NativeLibrary.load(Native Method)
        at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1946)
        at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1828)
        at java.lang.Runtime.load0(Runtime.java:811)
        at java.lang.System.load(System.java:1088)
        at com.sun.jna.Native.loadNativeDispatchLibraryFromClasspath(Native.java:1018)
        at com.sun.jna.Native.loadNativeDispatchLibrary(Native.java:988)
        at com.sun.jna.Native.<clinit>(Native.java:195)
        at com.sun.jna.platform.win32.Kernel32.<clinit>(Kernel32.java:42)
        at sbt.internal.io.WinMilli$.getHandle(Milli.scala:272)
        at sbt.internal.io.WinMilli$.getModifiedTimeNative(Milli.scala:300)
        at sbt.internal.io.WinMilli$.getModifiedTimeNative(Milli.scala:268)
        at sbt.internal.io.MilliNative.getModifiedTime(Milli.scala:63)
        at sbt.internal.io.Milli$.getModifiedTime(Milli.scala:381)
        at sbt.io.IO$.$anonfun$getModifiedTimeOrZero$1(IO.scala:1373)
        at scala.runtime.java8.JFunction0$mcJ$sp.apply(JFunction0$mcJ$sp.java:23)
        at sbt.internal.io.Retry$.liftedTree2$1(Retry.scala:38)
        at sbt.internal.io.Retry$.impl$1(Retry.scala:38)
        at sbt.internal.io.Retry$.apply(Retry.scala:52)
        at sbt.internal.io.Retry$.apply(Retry.scala:24)
        at sbt.io.IO$.getModifiedTimeOrZero(IO.scala:1373)
        at sbt.internal.classpath.ClassLoaderCache$Key$$anonfun$$lessinit$greater$3.apply(ClassLoaderCache.scala:55)
        at sbt.internal.classpath.ClassLoaderCache$Key$$anonfun$$lessinit$greater$3.apply(ClassLoaderCache.scala:55)
        at scala.collection.immutable.List.map(List.scala:286)
        at sbt.internal.classpath.ClassLoaderCache$Key.<init>(ClassLoaderCache.scala:55)
        at sbt.internal.classpath.ClassLoaderCache.cachedCustomClassloader(ClassLoaderCache.scala:178)
        at sbt.State$StateOpsImpl$.initializeClassLoaderCache$extension(State.scala:358)
        at sbt.StandardMain$.initialState(Main.scala:179)
        at sbt.xMain$.run(Main.scala:65)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at sbt.internal.XMainConfiguration.run(XMainConfiguration.scala:45)
        at sbt.xMain.run(Main.scala:39)
        at xsbt.boot.Launch$$anonfun$run$1.apply(Launch.scala:111)
        at xsbt.boot.Launch$.withContextLoader(Launch.scala:130)
        at xsbt.boot.Launch$.run(Launch.scala:111)
        at xsbt.boot.Launch$$anonfun$apply$1.apply(Launch.scala:37)
        at xsbt.boot.Launch$.launch(Launch.scala:119)
        at xsbt.boot.Launch$.apply(Launch.scala:20)
        at xsbt.boot.Boot$.runImpl(Boot.scala:56)
        at xsbt.boot.Boot$.main(Boot.scala:18)
        at xsbt.boot.Boot.main(Boot.scala)
[error] [launcher] error during sbt launcher: java.lang.UnsatisfiedLinkError: C:\Users\XXXXXX\AppData\Local\Temp\jna-1267368576\jna3471279410491450454.dll: Can't find dependent libraries

The above error occurs no matter whether You have admin privileges in Windows or not.

@pablo53 pablo53 added the Bug label Apr 4, 2020
@eed3si9n
Copy link
Member

eed3si9n commented Apr 5, 2020

@pablo53 Thanks for the report. sbt version is determined by the content of project/build.properties file. Does your project have project/build.properties? Does it specify 1.3.9? If so could you try with 1.3.8 or 1.2.8 and see if they work?

@eed3si9n eed3si9n added area/windows Windows-specific issue needs info Needs more information to take further actions. labels Apr 5, 2020
@eed3si9n
Copy link
Member

I am closing this due to inactivity, but if this is still relevant let us know with more details.

@rubin55
Copy link

rubin55 commented May 9, 2022

I would like to add that this is still the case on Windows 11, using SBT 1.6.2 (specified in project/build.properties). Is there something I can do to help debug this? It seems to me sbt itself is depending in Jansi, which is not available (I suppose it should only use Jansi if it's found on the classpath, and just revert to uncolored defaults if it's not available).

My os.name and os.arch (this is a Windows on ARM device):

jshell> System.getProperty("os.name");
$2 ==> "Windows 11"
jshell> System.getProperty("os.arch");
$3 ==> "aarch64"

When running sbt:

> sbt
May 09, 2022 10:02:40 PM org.jline.utils.Log logr
WARNING: Unable to create a system terminal, creating a dumb terminal (enable debug logging for more information)
java.lang.NoClassDefFoundError: Could not initialize class org.fusesource.jansi.internal.Kernel32
        at sbt.internal.util.WindowsSupport$.getConsoleMode(WindowsInputStream.scala:20)
        at sbt.internal.util.JLine3$.setEnableProcessInput(JLine3.scala:234)
        at sbt.internal.util.JLine3$.enterRawMode(JLine3.scala:244)
        at sbt.internal.util.Terminal$ConsoleTerminal.enterRawMode(Terminal.scala:861)
        at sbt.internal.util.Terminal$ConsoleTerminal.<init>(Terminal.scala:820)
        at sbt.internal.util.Terminal$.newConsoleTerminal(Terminal.scala:758)
        at sbt.internal.util.Terminal$.withStreams(Terminal.scala:346)
        at sbt.xMain$.withStreams$1(Main.scala:87)
        at sbt.xMain$.run(Main.scala:121)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        at sbt.internal.XMainConfiguration.run(XMainConfiguration.java:57)
        at sbt.xMain.run(Main.scala:46)
        at xsbt.boot.Launch$.$anonfun$run$1(Launch.scala:149)
        at xsbt.boot.Launch$.withContextLoader(Launch.scala:176)
        at xsbt.boot.Launch$.run(Launch.scala:149)
        at xsbt.boot.Launch$.$anonfun$apply$1(Launch.scala:44)
        at xsbt.boot.Launch$.launch(Launch.scala:159)
        at xsbt.boot.Launch$.apply(Launch.scala:44)
        at xsbt.boot.Launch$.apply(Launch.scala:21)
        at xsbt.boot.Boot$.runImpl(Boot.scala:78)
        at xsbt.boot.Boot$.run(Boot.scala:73)
        at xsbt.boot.Boot$.main(Boot.scala:21)
        at xsbt.boot.Boot.main(Boot.scala)
[error] [launcher] error during sbt launcher: java.lang.NoClassDefFoundError: Could not initialize class org.fusesource.jansi.internal.Kernel32

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/windows Windows-specific issue Bug needs info Needs more information to take further actions.
Projects
None yet
Development

No branches or pull requests

3 participants