I am working on Windows 10 OS and installed sbt 1.4.5 from the .msi installer from scala-lang downloads page. Now when I type sbt or sbt about in the command prompt, it works fine but as soon as I type sbt console, I get the following error message:
C:\Users\anka2\Scala_Samples\Variables>sbt console
[warn] Neither build.sbt nor a 'project' directory in the current directory: "C:\Users\anka2\Scala_Samples\Variables"
c) continue
q) quit
?c
[warn] No sbt.version set in project/build.properties, base directory: C:\Users\anka2\Scala_Samples\Variables
[info] welcome to sbt 1.4.5 (Oracle Corporation Java 1.8.0_271)
[info] loading global plugins from C:\Users\anka2\.sbt\1.0\plugins
[info] set current project to variables (in build file:/C:/Users/anka2/Scala_Samples/Variables/)
[error] java.nio.file.InvalidPathException: Illegal char <"> at index 0: "C:\Windows\System32
[error] at sun.nio.fs.WindowsPathParser.normalize(WindowsPathParser.java:182)
[error] at sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:153)
[error] at sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:77)
[error] at sun.nio.fs.WindowsPath.parse(WindowsPath.java:94)
[error] at sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:255)
[error] at java.io.File.toPath(File.java:2234)
[error] at sbt.internal.inc.classpath.ClasspathUtil$.$anonfun$javaLibraryPaths$1(ClasspathUtilities.scala:62)
[error] at scala.collection.TraversableLike.$anonfun$map$1(TraversableLike.scala:285)
[error] at scala.collection.IndexedSeqOptimized.foreach(IndexedSeqOptimized.scala:36)
[error] at scala.collection.IndexedSeqOptimized.foreach$(IndexedSeqOptimized.scala:33)
[error] at scala.collection.mutable.WrappedArray.foreach(WrappedArray.scala:38)
[error] at scala.collection.TraversableLike.map(TraversableLike.scala:285)
[error] at scala.collection.TraversableLike.map$(TraversableLike.scala:278)
[error] at scala.collection.AbstractTraversable.map(Traversable.scala:108)
[error] at sbt.internal.inc.classpath.ClasspathUtil$.javaLibraryPaths(ClasspathUtilities.scala:62)
[error] at sbt.internal.inc.classpath.ClasspathUtil$$anon$2.<init>(ClasspathUtilities.scala:50)
[error] at sbt.internal.inc.classpath.ClasspathUtil$.toLoader(ClasspathUtilities.scala:48)
[error] at sbt.internal.inc.classpath.ClasspathUtil$.makeLoader(ClasspathUtilities.scala:115)
[error] at sbt.internal.inc.classpath.ClasspathUtil$.makeLoader(ClasspathUtilities.scala:103)
[error] at sbt.Defaults$.$anonfun$consoleTask$1(Defaults.scala:2043)
[error] at sbt.Defaults$.$anonfun$consoleTask$1$adapted(Defaults.scala:2037)
[error] at scala.Function1.$anonfun$compose$1(Function1.scala:49)
[error] at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:62)
[error] at sbt.std.Transform$$anon$4.work(Transform.scala:68)
[error] at sbt.Execute.$anonfun$submit$2(Execute.scala:282)
[error] at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:23)
[error] at sbt.Execute.work(Execute.scala:291)
[error] at sbt.Execute.$anonfun$submit$1(Execute.scala:282)
[error] at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:265)
[error] at sbt.CompletionService$$anon$2.call(CompletionService.scala:64)
[error] at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
[error] at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
[error] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
[error] at java.lang.Thread.run(Thread.java:748)
[error] (Compile / console) java.nio.file.InvalidPathException: Illegal char <"> at index 0: "C:\Windows\System32
[error] Total time: 0 s, completed Jan 17, 2021 11:25:34 AM
I tried identifying the error in format by running sbt --verbose and this is what I'm getting:-
C:\Users\anka2>sbt --verbose
# Executing command line:
"C:\Program Files\Java\jdk1.8.0_271\bin\java.exe"
-Dfile.encoding=UTF-8
-Xms1024m
-Xmx1024m
-Xss4M
-XX:ReservedCodeCacheSize=128m
-cp
"C:\Program Files (x86)\sbt\\bin\sbt-launch.jar"
xsbt.boot.Boot
[info] welcome to sbt 1.4.5 (Oracle Corporation Java 1.8.0_271)
[info] loading global plugins from C:\Users\anka2\.sbt\1.0\plugins
[info] loading project definition from C:\Users\anka2\project
[info] set current project to anka2 (in build file:/C:/Users/anka2/)
[info] sbt server started at local:sbt-server-ff142d10856e0dc0f951
[info] started sbt server
But after this, as soon as I type console, I get the same InvalidPath exception message.
It might be elementary but I am absolutely unable to grasp where I am going wrong or how to fix this.
It fails because you are running this command from folder that is not an sbt project. As you can see in your error:
Neither build.sbt nor a 'project' directory in the current directory: "C:\Users\anka2\Scala_Samples\Variables"
Please add to the directory when you want to run it:
project\build.properties file with the content:
sbt.version = 1.4.5
build.sbt file with the content:
name := "test213"
version := "0.1"
scalaVersion := "2.13.4"
Then try to rerun this command.
The problem is SBT is missing couple of files.
Fix: Using cmd
cd to an empty folder.
C:\Users\USER\scala_sample_learning> sbt new scala/hello-world.g8
upon successful implementation of step 2 cmd will prompt you for a name give hello-world
Now you can use sbt console
Related
Edit : I know now that I need to access Google Oauth2 authentication with some sort of sbt configuration but I can't find how on official documention...
We recently added a Google Authentication and it seems that instead of loading the sha1, it loads the google auth HTML page.
Anyone knows how to add Google SSO credentials to sbt credentials ? I already have Nexus credentials defined and it was working fine before Google SSO was added
Initial Question :
I launched a new Scala project with sbt.version = 1.4.9 and scalaVersion := "2.12.14" and got the following error.
I tried :
Reinstalling Scala, Sbt, Java.
Changing their version (sbt 1.3.X, 1.4.X / Scala 2.11.X, 2.12.X / Java 8 and 11 openjdk)
Removing everything except the simplest build.sbt (name and scala version),
Removing coursier cache and ivy cache,
Rebooting my computer (MacOS)
Nothing worked...
sbt:quality-orc-delta> compile
[info] Updating
[info] Resolved dependencies
[error] stack trace is suppressed; run last update for the full output
[error] (update) java.lang.NumberFormatException: For input string: "vars"
[error] Total time: 1 s, completed 19 May 2022, 06:54:38
sbt:quality-orc-delta> last update
[debug] not up to date. inChanged = true, force = false
[debug] Updating ...
[info] Updating
[info] Resolved dependencies
[error] java.lang.NumberFormatException: For input string: "vars"
[error] at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
[error] at java.base/java.lang.Integer.parseInt(Integer.java:652)
[error] at java.base/java.math.BigInteger.<init>(BigInteger.java:534)
[error] at lmcoursier.internal.shaded.coursier.cache.CacheChecksum$$anonfun$findChecksum$1.applyOrElse(CacheChecksum.scala:22)
[error] at lmcoursier.internal.shaded.coursier.cache.CacheChecksum$$anonfun$findChecksum$1.applyOrElse(CacheChecksum.scala:20)
[error] at scala.collection.TraversableOnce.collectFirst(TraversableOnce.scala:172)
[error] at scala.collection.TraversableOnce.collectFirst$(TraversableOnce.scala:159)
[error] at scala.collection.AbstractTraversable.collectFirst(Traversable.scala:108)
[error] at lmcoursier.internal.shaded.coursier.cache.CacheChecksum$.findChecksum(CacheChecksum.scala:20)
[error] at lmcoursier.internal.shaded.coursier.cache.CacheChecksum$.$anonfun$parseChecksumAlternative$2(CacheChecksum.scala:31)
[error] at scala.Option.orElse(Option.scala:447)
[error] at lmcoursier.internal.shaded.coursier.cache.CacheChecksum$.parseChecksumAlternative(CacheChecksum.scala:30
[error] at lmcoursier.internal.shaded.coursier.cache.CacheChecksum$.$anonfun$parseRawChecksum$1(CacheChecksum.scala:52)
[error] at scala.Option.orElse(Option.scala:447)
[error] at lmcoursier.internal.shaded.coursier.cache.CacheChecksum$.parseRawChecksum(CacheChecksum.scala:52)
[error] at lmcoursier.internal.shaded.coursier.cache.FileCache.$anonfun$validateChecksum$4(FileCache.scala:677)
[error] at scala.concurrent.Future$.$anonfun$apply$1(Future.scala:659)
[error] at scala.util.Success.$anonfun$map$1(Try.scala:255)
[error] at scala.util.Success.map(Try.scala:213)
[error] at scala.concurrent.Future.$anonfun$map$1(Future.scala:292)
[error] at scala.concurrent.impl.Promise.liftedTree1$1(Promise.scala:33)
[error] at scala.concurrent.impl.Promise.$anonfun$transform$1(Promise.scala:33)
[error] at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:64)
[error] at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
[error] at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
[error] at java.base/java.lang.Thread.run(Thread.java:834)
[error] (update) java.lang.NumberFormatException: For input string: "vars"
Any help is welcome.
I am going through https://www.squeryl.org/download.html to figure out how to import Squeryl using SBT. There it is written to add just one line libraryDependencies += "org.squeryl" %% "squeryl" % "0.9.5-6" in the build.sbt. However, when I add that same line in the file and then run sbt run on the terminal, I get thrown an error sbt.librarymanagement.ResolveException: Error downloading org.squeryl:squeryl_2.13:0.9.5-6. I searched in Google for that error but it looks like no one else has ever had that issue before. Can someone please help me out with what can be done to resolve the issue?
The full error is pasted below in case it helps:
$ sbt run
[info] Loading settings for project taxonomy-build from plugins.sbt ...
[info] Loading project definition from /Users/s1b01g3/durden-temp/durden/services/taxonomy/project
[info] Loading settings for project root from build.sbt ...
[info] Set current project to taxonomy (in build file:/Users/s1b01g3/durden-temp/durden/services/taxonomy/)
[info] Updating
[info] Resolved dependencies
[warn]
[warn] Note: Unresolved dependencies path:
[error] sbt.librarymanagement.ResolveException: Error downloading org.squeryl:squeryl_2.13:0.9.5-6
[error] Not found
[error] Not found
[error] not found: /Users/s1b01g3/.ivy2/local/org.squeryl/squeryl_2.13/0.9.5-6/ivys/ivy.xml
[error] not found: https://repo1.maven.org/maven2/org/squeryl/squeryl_2.13/0.9.5-6/squeryl_2.13-0.9.5-6.pom
[error] at lmcoursier.CoursierDependencyResolution.unresolvedWarningOrThrow(CoursierDependencyResolution.scala:245)
[error] at lmcoursier.CoursierDependencyResolution.$anonfun$update$34(CoursierDependencyResolution.scala:214)
[error] at scala.util.Either$LeftProjection.map(Either.scala:573)
[error] at lmcoursier.CoursierDependencyResolution.update(CoursierDependencyResolution.scala:214)
[error] at sbt.librarymanagement.DependencyResolution.update(DependencyResolution.scala:60)
[error] at sbt.internal.LibraryManagement$.resolve$1(LibraryManagement.scala:52)
[error] at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$12(LibraryManagement.scala:102)
[error] at sbt.util.Tracked$.$anonfun$lastOutput$1(Tracked.scala:69)
[error] at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$20(LibraryManagement.scala:115)
[error] at scala.util.control.Exception$Catch.apply(Exception.scala:228)
[error] at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$11(LibraryManagement.scala:115)
[error] at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$11$adapted(LibraryManagement.scala:96)
[error] at sbt.util.Tracked$.$anonfun$inputChanged$1(Tracked.scala:150)
[error] at sbt.internal.LibraryManagement$.cachedUpdate(LibraryManagement.scala:129)
[error] at sbt.Classpaths$.$anonfun$updateTask0$5(Defaults.scala:2946)
[error] at scala.Function1.$anonfun$compose$1(Function1.scala:49)
[error] at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:62)
[error] at sbt.std.Transform$$anon$4.work(Transform.scala:67)
[error] at sbt.Execute.$anonfun$submit$2(Execute.scala:281)
[error] at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:19)
[error] at sbt.Execute.work(Execute.scala:290)
[error] at sbt.Execute.$anonfun$submit$1(Execute.scala:281)
[error] at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:178)
[error] at sbt.CompletionService$$anon$2.call(CompletionService.scala:37)
[error] at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
[error] at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
[error] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
[error] at java.lang.Thread.run(Thread.java:748)
[error] (update) sbt.librarymanagement.ResolveException: Error downloading org.squeryl:squeryl_2.13:0.9.5-6
[error] Not found
[error] Not found
[error] not found: /Users/s1b01g3/.ivy2/local/org.squeryl/squeryl_2.13/0.9.5-6/ivys/ivy.xml
[error] not found: https://repo1.maven.org/maven2/org/squeryl/squeryl_2.13/0.9.5-6/squeryl_2.13-0.9.5-6.pom
[error] Total time: 3 s, completed 17 Jan, 2020 4:19:54 PM
Any kind of help whatsoever would be highly appreciated. Thanks a lot.
The problem is that squeryl 0.9.5-6 was never released for Scala 2.13.
In such a case, just have a look at mvnrepository.com, searching for your artifact:
https://mvnrepository.com/artifact/org.squeryl/squeryl
The table tells you which version was published for Scala 2.13: 0.9.14
I am trying to deploy my application to Heroku using sbt-nativepackager and sbt-heroku.
My code is available at https://github.com/hhimanshu/sbt101/tree/m5 (branch is m5)
When I run sbt stage deployHeroku, the application fails as below
➜ sbt101 git:(m5) ✗ sbt stage deployHeroku
[info] Loading global plugins from /Users/harit/.sbt/1.0/plugins
[info] Loading settings for project sbt101-build from plugins.sbt ...
[info] Loading project definition from /Users/harit/code/sc/sbt101/project
[info] Loading settings for project root from build.sbt ...
[info] Set current project to sbt101 (in build file:/Users/harit/code/sc/sbt101/)
[info] Packaging /Users/harit/code/sc/sbt101/api/target/scala-2.12/api_2.12-0.1.0-SNAPSHOT-sources.jar ...
[info] Done packaging.
[info] Wrote /Users/harit/code/sc/sbt101/api/target/scala-2.12/api_2.12-0.1.0-SNAPSHOT.pom
[info] Wrote /Users/harit/code/sc/sbt101/calculators/target/scala-2.12/calculators_2.12-0.1.0-SNAPSHOT.pom
[info] Main Scala API documentation to /Users/harit/code/sc/sbt101/api/target/scala-2.12/api...
[info] Compiling 1 Scala source to /Users/harit/code/sc/sbt101/api/target/scala-2.12/classes ...
model contains 3 documentable templates
[info] Done compiling.
[info] Main Scala API documentation successful.
[info] Packaging /Users/harit/code/sc/sbt101/api/target/scala-2.12/api_2.12-0.1.0-SNAPSHOT-javadoc.jar ...
[info] Packaging /Users/harit/code/sc/sbt101/api/target/scala-2.12/api_2.12-0.1.0-SNAPSHOT.jar ...
[info] Done packaging.
[info] Main Scala API documentation to /Users/harit/code/sc/sbt101/calculators/target/scala-2.12/api...
[info] Compiling 1 Scala source to /Users/harit/code/sc/sbt101/calculators/target/scala-2.12/classes ...
[info] Done packaging.
[warn] there was one feature warning; re-run with -feature for details
model contains 5 documentable templates
[warn] one warning found
[info] Main Scala API documentation successful.
[info] Packaging /Users/harit/code/sc/sbt101/calculators/target/scala-2.12/calculators_2.12-0.1.0-SNAPSHOT-javadoc.jar ...
[info] Done packaging.
[warn] there was one deprecation warning (since 2.11.0); re-run with -deprecation for details
[warn] there was one feature warning; re-run with -feature for details
[warn] two warnings found
[info] Done compiling.
[warn] Multiple main classes detected. Run 'show discoveredMainClasses' to see the list
[info] Packaging /Users/harit/code/sc/sbt101/calculators/target/scala-2.12/calculators_2.12-0.1.0-SNAPSHOT.jar ...
[info] Done packaging.
[success] Total time: 4 s, completed 10-May-2019 4:20:03 PM
[error] java.lang.RuntimeException: You must run the `stage` task before deploying your app!
[error] at com.heroku.sbt.SbtApp.packageType(SbtApp.scala:142)
[error] at com.heroku.sbt.SbtApp.prepare(SbtApp.scala:111)
[error] at com.heroku.sdk.deploy.App.deploy(App.java:60)
[error] at com.heroku.sbt.SbtApp.deploy(SbtApp.scala:98)
[error] at com.heroku.sbt.HerokuPlugin$autoImport$.$anonfun$baseHerokuSettings$1(HerokuPlugin.scala:53)
[error] at com.heroku.sbt.HerokuPlugin$autoImport$.$anonfun$baseHerokuSettings$1$adapted(HerokuPlugin.scala:26)
[error] at scala.Function1.$anonfun$compose$1(Function1.scala:44)
[error] at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:40)
[error] at sbt.std.Transform$$anon$4.work(System.scala:67)
[error] at sbt.Execute.$anonfun$submit$2(Execute.scala:269)
[error] at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:16)
[error] at sbt.Execute.work(Execute.scala:278)
[error] at sbt.Execute.$anonfun$submit$1(Execute.scala:269)
[error] at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:178)
[error] at sbt.CompletionService$$anon$2.call(CompletionService.scala:37)
[error] at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
[error] at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
[error] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
[error] at java.lang.Thread.run(Thread.java:748)
2019-05-10 16:20:03,606 Log4j2-TF-1-AsyncLogger[AsyncContext#cb644e]-1 ERROR Attempted to append to non-started appender heroku-logger
[error] (Compile / deployHeroku) You must run the `stage` task before deploying your app!
2019-05-10 16:20:03,607 Log4j2-TF-1-AsyncLogger[AsyncContext#cb644e]-1 ERROR Attempted to append to non-started appender heroku-logger
[error] Total time: 0 s, completed 10-May-2019 4:20:03 PM
However, using the Heroku toolbelt on command-line, I have been successful in deploying my app
➜ sbt101 git:(m5) ✗ git push heroku m5:master
The the app runs at https://h2-sbt101.herokuapp.com/rates
Can someone please help me understand what I may be missing?
I had the same problem. sbt deployHeroku looks for the directory target/universal/stage (see the source). However, it seems to look for it in the root project which may not be the one with the staged directory. For example, in the OP's log, it seems there are several projects called api and calculator. In my case, the correct one (containing the server code) was server.
So sbt stage server/deployHeroku worked for me.
idea2018.3
Scala 2.12 (idea plugin)
play2.6
sbt using the bundled in idea
build.properties sbt.version=1.1.6 even I change the version to 2 still have this error
in index server/target/scala-2.12/resolution-cache/org.scala-sbt.temp produce a directory 1.1.7
This project is getting from subversion. It can be compiled successfully in my Mac, when import this project to my development machine(Windows 10) in company. when i run, get the following errors:
[info] Loading settings from plugins.sbt,scaffold.sbt ...
[info] Loading project definition from D:\server\project
[info] Loading settings from build.sbt ...
[info] Set current project to targetingvis_server (in build file:/D:/server/)
--- (Running the application, auto-reloading is enabled) ---
[info] p.c.s.AkkaHttpServer - Listening for HTTP on /0:0:0:0:0:0:0:0:9000
Server started, use Alt+D to stop
[info] Compiling 12 Scala sources and 1 Java source to D:\server\target\scala-2.12\classes ...
[info] Attempting to fetch org.scala-sbt:compiler-bridge_2.12:1.1.7.
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: org.scala-sbt#compiler-bridge_2.12;1.1.7: public: unable to get resource for org/scala-sbt#compiler-bridge_2.12;1.1.7: res=https://repo1.maven.org/maven2/org/scala-sbt/compiler-bridge_2.12/1.1.7/compiler-bridge_2.12-1.1.7.pom: java.net.ConnectException: Failed to connect to repo1.maven.org/151.101.196.209:443
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[error] ## Exception when compiling 13 sources to D:\server\target\scala-2.12\classes
[error] The compiler bridge sources org.scala-sbt:compiler-bridge_2.12:1.1.7:compile could not be retrieved.
[error]
[error] Note: Unresolved dependencies path:
[error] org.scala-sbt:compiler-bridge_2.12:1.1.7
[error] +- org.scala-sbt.temp:temp-module-98ec89c315ed408f615fff2c4774286d17323b01:1.1.7
[error] sbt.internal.inc.ZincComponentCompiler.$anonfun$compileAndInstall$3(ZincComponentCompiler.scala:274)
[error] sbt.internal.inc.ZincComponentCompiler.$anonfun$compileAndInstall$3$adapted(ZincComponentCompiler.scala:264)
[error] sbt.io.IO$.withTemporaryDirectory(IO.scala:376)
[error] sbt.io.IO$.withTemporaryDirectory(IO.scala:383)
[error] sbt.internal.inc.ZincComponentCompiler.$anonfun$compileAndInstall$2(ZincComponentCompiler.scala:264)
[error] scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
[error] sbt.internal.util.BufferedLogger.bufferQuietly(BufferedLogger.scala:106)
[error] sbt.internal.inc.ZincComponentCompiler.$anonfun$compileAndInstall$1(ZincComponentCompiler.scala:264)
[error] sbt.internal.inc.ZincComponentCompiler.$anonfun$compileAndInstall$1$adapted(ZincComponentCompiler.scala:261)
[error] sbt.io.IO$.withTemporaryDirectory(IO.scala:376)
[error] sbt.io.IO$.withTemporaryDirectory(IO.scala:383)
[error] sbt.internal.inc.ZincComponentCompiler.compileAndInstall(ZincComponentCompiler.scala:261)
[error] sbt.internal.inc.ZincComponentCompiler.$anonfun$compiledBridgeJar$1(ZincComponentCompiler.scala:227)
[error] sbt.internal.inc.IfMissing$Define.run(IfMissing.scala:19)
[error] sbt.internal.inc.ZincComponentManager.createAndCache$1(ZincComponentManager.scala:46)
[error] sbt.internal.inc.ZincComponentManager.$anonfun$files$3(ZincComponentManager.scala:57)
[error] sbt.internal.inc.ZincComponentManager.getOrElse$1(ZincComponentManager.scala:38)
[error] sbt.internal.inc.ZincComponentManager.$anonfun$files$2(ZincComponentManager.scala:57)
[error] sbt.internal.inc.ZincComponentManager$$anon$1.call(ZincComponentManager.scala:87)
[error] xsbt.boot.Locks$GlobalLock.withChannel$1(Locks.scala:95)
[error] xsbt.boot.Locks$GlobalLock.xsbt$boot$Locks$GlobalLock$$withChannelRetries$1(Locks.scala:80)
[error] xsbt.boot.Locks$GlobalLock$$anonfun$withFileLock$1.apply(Locks.scala:99)
[error] xsbt.boot.Using$.withResource(Using.scala:10)
[error] xsbt.boot.Using$.apply(Using.scala:9)
[error] xsbt.boot.Locks$GlobalLock.ignoringDeadlockAvoided(Locks.scala:60)
[error] xsbt.boot.Locks$GlobalLock.withLock(Locks.scala:50)
[error] xsbt.boot.Locks$.apply0(Locks.scala:31)
[error] xsbt.boot.Locks$.apply(Locks.scala:28)
[error] sbt.internal.inc.ZincComponentManager.lock(ZincComponentManager.scala:87)
[error] sbt.internal.inc.ZincComponentManager.$anonfun$lockSecondaryCache$1(ZincComponentManager.scala:84)
[error] scala.Option.map(Option.scala:146)
[error] sbt.internal.inc.ZincComponentManager.lockSecondaryCache(ZincComponentManager.scala:82)
[error] sbt.internal.inc.ZincComponentManager.fromSecondary$1(ZincComponentManager.scala:55)
[error] sbt.internal.inc.ZincComponentManager.$anonfun$files$6(ZincComponentManager.scala:61)
[error] sbt.internal.inc.ZincComponentManager.getOrElse$1(ZincComponentManager.scala:38)
[error] sbt.internal.inc.ZincComponentManager.$anonfun$files$5(ZincComponentManager.scala:61)
[error] sbt.internal.inc.ZincComponentManager$$anon$1.call(ZincComponentManager.scala:87)
[error] xsbt.boot.Locks$GlobalLock.withChannel$1(Locks.scala:95)
[error] xsbt.boot.Locks$GlobalLock.xsbt$boot$Locks$GlobalLock$$withChannelRetries$1(Locks.scala:80)
[error] xsbt.boot.Locks$GlobalLock$$anonfun$withFileLock$1.apply(Locks.scala:99)
[error] xsbt.boot.Using$.withResource(Using.scala:10)
[error] xsbt.boot.Using$.apply(Using.scala:9)
[error] xsbt.boot.Locks$GlobalLock.ignoringDeadlockAvoided(Locks.scala:60)
[error] xsbt.boot.Locks$GlobalLock.withLock(Locks.scala:50)
[error] xsbt.boot.Locks$.apply0(Locks.scala:31)
[error] xsbt.boot.Locks$.apply(Locks.scala:28)
[error] sbt.internal.inc.ZincComponentManager.lock(ZincComponentManager.scala:87)
[error] sbt.internal.inc.ZincComponentManager.lockLocalCache(ZincComponentManager.scala:78)
[error] sbt.internal.inc.ZincComponentManager.files(ZincComponentManager.scala:61)
[error] application -
! #7ac7f7pgj - Internal server error, for (GET) [/] ->
play.sbt.PlayExceptions$UnexpectedException: Unexpected exception[InvalidComponent: The compiler bridge sources org.scala-sbt:compiler-bridge_2.12:1.1.7:compile could not be retrieved.
Note: Unresolved dependencies path:
org.scala-sbt:compiler-bridge_2.12:1.1.7
+- org.scala-sbt.temp:temp-module-98ec89c315ed408f615fff2c4774286d17323b01:1.1.7]
at play.sbt.run.PlayReload$.$anonfun$taskFailureHandler$1(PlayReload.scala:35)
at scala.Option.map(Option.scala:146)
at play.sbt.run.PlayReload$.taskFailureHandler(PlayReload.scala:28)
at play.sbt.run.PlayReload$.compileFailure(PlayReload.scala:24)
at play.sbt.run.PlayReload$.$anonfun$compile$3(PlayReload.scala:51)
at scala.util.Either$LeftProjection.map(Either.scala:573)
at play.sbt.run.PlayReload$.compile(PlayReload.scala:51)
at play.sbt.run.PlayRun$.$anonfun$playRunTask$4(PlayRun.scala:76)
at play.runsupport.Reloader.$anonfun$reload$1(Reloader.scala:412)
at play.runsupport.Reloader$$anon$5.run(Reloader.scala:50)
I had the same problem recently. This occurs when the SBT cannot access the internet and cannot download the compiler bridge library, e.g. due to proxy.
The compiler bridge is located in the .sbt folder (on Windows it is C:\Users\<user>\.sbt, on Linux: ~/.sbt).
As of SBT 1.6.2, the bridge libraries are in .sbt/1.0/zinc/org.scala-sbt/:
E.g. org.scala-sbt-compiler-bridge_2.11-1.5.7-bin_2.11.12__52.0-1.5.7_20210712T054328.jar
One way to fix it is to check if SBT can access the internet. If it is behind a proxy, configure the proxy settings.
The other way to fix it is to copy the .sbt folder from a working environment. This can work also for the offline use.
I'm trying to build the JDT Core library with maven. I downloaded the git repository and in that folder I issued: mvn -P build-individual-bundles package
I get the error below after a few minutes. Any ideas? TIA!
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5:04.943s
[INFO] Finished at: Wed Sep 24 08:36:51 PDT 2014
[INFO] Final Memory: 82M/455M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.eclipse.tycho:tycho-compiler-plugin:0.21.0:compile (default-compile) on project org.eclipse.jdt.annotation: Compilation failure: Compilation failure:
[ERROR] F:\Workspace\git\eclipse-jdt-core\org.eclipse.jdt.annotation\src\org\eclipse\jdt\annotation\NonNull.java:[14]
[ERROR] import static java.lang.annotation.ElementType.TYPE_USE;
[ERROR] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[ERROR] The import java.lang.annotation.ElementType.TYPE_USE cannot be resolved
[ERROR] F:\Workspace\git\eclipse-jdt-core\org.eclipse.jdt.annotation\src\org\eclipse\jdt\annotation\NonNull.java:[52]
[ERROR] #Target({ TYPE_USE })
[ERROR] ^^^^^^^^
[ERROR] TYPE_USE cannot be resolved to a variable
[ERROR] F:\Workspace\git\eclipse-jdt-core\org.eclipse.jdt.annotation\src\org\eclipse\jdt\annotation\Nullable.java:[14]
[ERROR] import static java.lang.annotation.ElementType.TYPE_USE;
[ERROR] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[ERROR] The import java.lang.annotation.ElementType.TYPE_USE cannot be resolved
[ERROR] F:\Workspace\git\eclipse-jdt-core\org.eclipse.jdt.annotation\src\org\eclipse\jdt\annotation\Nullable.java:[43]
[ERROR] #Target({ TYPE_USE })
[ERROR] ^^^^^^^^
[ERROR] TYPE_USE cannot be resolved to a variable
[ERROR] 4 problems (4 errors)
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :org.eclipse.jdt.annotation
Version information:
F:\Workspace\git\eclipse-jdt-core>mvn -version
Apache Maven 3.1.1 (0728685237757ffbf44136acec0402957f723d9a; 2013-09-17 08:22:22-0700)
Maven home: C:\Apps\Java\apache-maven-3.1.1\bin\..
Java version: 1.7.0_67, vendor: Oracle Corporation
Java home: C:\Apps\Java\jdk1.7.0_67\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"
Looks like it needs to be compiled with Java 8.
java.lang.annotation.ElementType.TYPE_USE is new in Java 8.