source code example install java crash
See original GitHub issueProblem: When trying to install the example code for the FP in Scala it fails.
NOTE: issue 548 looks similar, but is closed. It blames the problem on ‘sbt’. I am running the lastest sbt I can find for the mac.
I am new to scala and java. Lots of C++ and ruby in my background.
The only reason I was installing the examples is because code in the book did not run without a definition of Cons() for work with Lists and I hoped the install would provide a definition.
Environment My computer is a Mac book pro running Sierra 10.12.6 sbt version is 1.2.8 scala -version * Scala code runner version 2.11.4 – Copyright 2002-2013, LAMP/EPFL java -version * openjdk 11.0.1 2018-10-16 * OpenJDK Runtime Environment 18.9 (build 11.0.1+13) * OpenJDK 64-Bit Server VM 18.9 (build 11.0.1+13, mixed mode)
Here’s a log of the problem:
% rm -rf ~/.sbt
% git clone https://github.com/fpinscala/fpinscala.git
Cloning into 'fpinscala'...
remote: Enumerating objects: 3052, done.
remote: Total 3052 (delta 0), reused 0 (delta 0), pack-reused 3052
Receiving objects: 100% (3052/3052), 5.01 MiB | 7.01 MiB/s, done.
Resolving deltas: 100% (944/944), done.
% cd fpinscala; ls
LICENSE answers project sbt.bat
README.md build.sbt sbt sbt.cmd
answerkey exercises sbt-launch.jar
% chmod +x ./sbt
% ./sbt
OpenJDK 64-Bit Server VM warning: Ignoring option MaxPermSize; support was removed in 8.0
Getting org.scala-sbt sbt 0.13.13 ...
:: retrieving :: org.scala-sbt#boot-app
confs: [default]
50 artifacts copied, 0 already retrieved (17645kB/121ms)
Getting Scala 2.10.6 (for sbt)...
:: retrieving :: org.scala-sbt#boot-scala
confs: [default]
5 artifacts copied, 0 already retrieved (24494kB/94ms)
[info] Loading project definition from /Users/davei/fpinscala/project
[info] Updating {file:/Users/davei/fpinscala/project/}fpinscala-build...
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by sbt.ivyint.ErrorMessageAuthenticator$ (file:/Users/davei/.sbt/boot/scala-2.10.6/org.scala-sbt/sbt/0.13.13/ivy-0.13.13.jar) to field java.net.Authenticator.theAuthenticator
WARNING: Please consider reporting this to the maintainers of sbt.ivyint.ErrorMessageAuthenticator$
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
[info] Resolving org.scala-sbt.ivy#ivy;2.3.0-sbt-2cf13e211b2cb31f0d3b317289dca70[info] Resolving org.fusesource.jansi#jansi;1.4 ...
[info] Done updating.
java.lang.NullPointerException
at java.base/java.util.regex.Matcher.getTextLength(Matcher.java:1770)
at java.base/java.util.regex.Matcher.reset(Matcher.java:416)
at java.base/java.util.regex.Matcher.<init>(Matcher.java:253)
at java.base/java.util.regex.Pattern.matcher(Pattern.java:1133)
at java.base/java.util.regex.Pattern.split(Pattern.java:1261)
at java.base/java.util.regex.Pattern.split(Pattern.java:1334)
at sbt.IO$.pathSplit(IO.scala:797)
at sbt.IO$.parseClasspath(IO.scala:912)
at sbt.compiler.CompilerArguments.extClasspath(CompilerArguments.scala:66)
at sbt.compiler.MixedAnalyzingCompiler$.withBootclasspath(MixedAnalyzingCompiler.scala:188)
at sbt.compiler.MixedAnalyzingCompiler$.searchClasspathAndLookup(MixedAnalyzingCompiler.scala:166)
at sbt.compiler.MixedAnalyzingCompiler$.apply(MixedAnalyzingCompiler.scala:176)
at sbt.compiler.IC$.incrementalCompile(IncrementalCompiler.scala:138)
at sbt.Compiler$.compile(Compiler.scala:155)
at sbt.Compiler$.compile(Compiler.scala:141)
at sbt.Defaults$.sbt$Defaults$$compileIncrementalTaskImpl(Defaults.scala:879)
at sbt.Defaults$$anonfun$compileIncrementalTask$1.apply(Defaults.scala:870)
at sbt.Defaults$$anonfun$compileIncrementalTask$1.apply(Defaults.scala:868)
at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:40)
at sbt.std.Transform$$anon$4.work(System.scala:63)
at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:228)
at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:228)
at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17)
at sbt.Execute.work(Execute.scala:237)
at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:228)
at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:228)
at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:159)
at sbt.CompletionService$$anon$2.call(CompletionService.scala:28)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
[error] (compile:compileIncremental) java.lang.NullPointerException
Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore? i
[warn] Ignoring load failure: no project loaded.
>
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:9 (1 by maintainers)
Top GitHub Comments
Try to use JDK 8.
Orlando,
Thanks so much for the time you spent replying to me - it’s very thoughtful. I am away from my scala platform, but will try your suggestion as I get back to it.
Dave