PredictionIO Mavericks installation - prediction

I am using official install guide:
http://docs.prediction.io/0.8.0/install/install-sourcecode.html
$ git clone https://github.com/PredictionIO/PredictionIO.git
$ cd PredictionIO
$ ./make-distribution.sh
after typing those commands I got error:
[warn] Class org.apache.hadoop.mapreduce.Job not found - continuing with a stub.
[warn] Class org.apache.hadoop.mapred.JobConf not found - continuing with a stub.
[warn] Class java.lang.AutoCloseable not found - continuing with a stub.
[error]
[error] while compiling: /Users/voldemar/tmp/PredictionIO/data/src/main/scala/storage/elasticsearch/ESEngineInstances.scala
[error] during phase: typer
[error] library version: version 2.10.4
[error] compiler version: version 2.10.4
Please, advise me solution for installation PredictionIO on OSX system.

Problem solved with installation of JDK 7.

Related

Scala SBT Plugin Version Error During Build

I keep getting the following error from my GitHub Actions workflow:
[info] welcome to sbt 1.7.1 (Eclipse Adoptium Java 11.0.16.1)
[info] loading settings for project plant-simulator-build from plugins.sbt ...
[info] loading project definition from /home/runner/work/plant-simulator/plant-simulator/project
[warn]
[warn] Note: Some unresolved dependencies have extra attributes. Check that these dependencies exist with the requested attributes.
[warn] org.scoverage:sbt-scoverage:2.0.7 (sbtVersion=1.0, scalaVersion=2.12)
[warn]
[warn] Note: Unresolved dependencies path:
[error] sbt.librarymanagement.ResolveException: Error downloading org.scoverage:sbt-scoverage;sbtVersion=1.0;scalaVersion=2.12:2.0.7
[error] Not found
[error] Not found
[error] not found: https://repo1.maven.org/maven2/org/scoverage/sbt-scoverage_2.12_1.0/2.0.7/sbt-scoverage-2.0.7.pom
[error] not found: /home/runner/.ivy2/localorg.scoverage/sbt-scoverage/scala_2.12/sbt_1.0/2.0.7/ivys/ivy.xml
[error] not found: https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/org.scoverage/sbt-scoverage/scala_2.12/sbt_1.0/2.0.7/ivys/ivy.xml
[error] not found: https://repo.typesafe.com/typesafe/ivy-releases/org.scoverage/sbt-scoverage/scala_2.12/sbt_1.0/2.0.7/ivys/ivy.xml
[error] at lmcoursier.CoursierDependencyResolution.unresolvedWarningOrThrow(CoursierDependencyResolution.scala:345)
[error] at lmcoursier.CoursierDependencyResolution.$anonfun$update$38(CoursierDependencyResolution.scala:314)
[error] at scala.util.Either$LeftProjection.map(Either.scala:573)
[error] at lmcoursier.CoursierDependencyResolution.update(CoursierDependencyResolution.scala:314)
I have the following defined in my project/plugins.sbt file:
// For code coverage test
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.0.7")
My question is, why is it taking the 2.12_1.0 scoverage version instead of 2.12.17_2.0.7? This is ruining my build. Any ideas on how to fix this?
My question is, why is it taking the 2.12_1.0 scoverage version instead of 2.12.17_2.0.7?
It's not. It is trying to find version 2.0.7 of the plugin. The 2.12 refer to the Scala version of plugins expected by SBT (different from the version of your project), and 1.0 refer to SBT major version.
The error message is relatively clear:
Note: Some unresolved dependencies have extra attributes. Check that these dependencies exist with the requested attributes.
org.scoverage:sbt-scoverage:2.0.7 (sbtVersion=1.0, scalaVersion=2.12)
This is ruining my build. Any ideas on how to fix this?
There's no version 2.0.7 as of today. Latest is 2.0.5. Check out the GitHub page of the plugin for reference: https://github.com/scoverage/sbt-scoverage.

How to correctly prepare and setting preloaded sbt lib

In my situation, I cannot access internet in my office linux server. Therefore, I installed sbt in my personal computer. I followed instructions on sbt official web-site and run/compile a "hello world" for getting all dependency data.
Then, I copied ~/.ivy2 and ~/.sbt and sbt bin folders to my offline office desktop. But when I run sbt, I got these errors:
[info] welcome to sbt 1.4.9 (Oracle Corporation Java 1.8.0_25)
[info] loading project definition from /proj/mtk07847/test/scala/project
[info] Updating
[info] Resolved dependencies
[warn]
[warn] Note: Unresolved dependencies path:
[error] sbt.librarymanagement.ResolveException: Error downloading org.scala-lang:scala-library:2.12.12
[error] Not found
[error] Not found
[error] download error: Caught java.net.SocketException: Connection reset (Connection reset) while downloading https://repo1.maven.org/maven2/org/s
cala-lang/scala-library/2.12.12/scala-library-2.12.12.pom
[error] not found: ~/.ivy2/localorg.scala-lang/scala-library/2.12.12/ivys/ivy.xml
...
It seems that sbt tried to download missing scala-library:2.12.12 which I already prepared.
In my ~/.ivy2 folder,the structure and path looks like the following:
~/.ivy2/cache/org.scala-lang/scala-library/jars/scala-library-2.12.12.jar
~/.ivy2/cache/org.scala-lang/scala-library/ivy-2.12.12.xml
~/.ivy2/cache/org.scala-lang/scala-library/ivy-2.12.12.xml.original
~/.ivy2/cache/org.scala-lang/scala-library/ivydata-2.12.12.properties
which is different from above messages:
[error] not found: ~/.ivy2/localorg.scala-lang/scala-library/2.12.12/ivys/ivy.xml
should I modified any describing files to indicate searching path or rule for sbt? or this method
is totally wrong (if so, can anyone know the flow guide me the better way?)

sbt new RuntimeException

I got lost trying to start with a scala toy example, when running sbt new scala/hello-world.g8 or even sbt new, the program crashes with the following error. Any ideas what might be wrong? Thanks in advance!
(In fact, I am running sbt -java-home /usr/lib/jvm/jdk-8-oracle-x64 new since my system uses older version of jdk by defualt)
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: org.antlr#ST4;4.0.8: org.sonatype.oss#oss-parent;9!oss-parent.pom(pom.original) origin location must be absolute: file:/home/michal/.m2/repository/org/sonatype/oss/oss-parent/9/oss-parent-9.pom
[warn] :: com.googlecode.javaewah#JavaEWAH;0.7.9: org.sonatype.oss#oss-parent;5!oss-parent.pom(pom.original) origin location must be absolute: file:/home/michal/.m2/repository/org/sonatype/oss/oss-parent/5/oss-parent-5.pom
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[error] java.lang.RuntimeException: Retrieval of org.scala-sbt.sbt-giter8-resolver:sbt-giter8-resolver:0.1.3 failed.
[error] at scala.sys.package$.error(package.scala:27)
[error] at sbt.TemplateCommandUtil$.classpathForInfo(TemplateCommand.scala:119)
[error] at sbt.TemplateCommandUtil$.infoLoader(TemplateCommand.scala:81)
[error] at sbt.TemplateCommandUtil$.$anonfun$run$1(TemplateCommand.scala:48)
[error] at sbt.TemplateCommandUtil$.$anonfun$run$1$adapted(TemplateCommand.scala:47)
[error] at sbt.TemplateCommandUtil$$$Lambda$1762/658781536.apply(Unknown Source)
...
[error] at xsbt.boot.Boot$.runImpl(Boot.scala:41)
[error] at xsbt.boot.Boot$.main(Boot.scala:17)
[error] at xsbt.boot.Boot.main(Boot.scala)
[error] Retrieval of org.scala-sbt.sbt-giter8-resolver:sbt-giter8-resolver:0.1.3 failed.
[error] Use 'last' for the full log.
I had this problem too. I fixed it by blowing away my ~/.ivy2 directory
I had this problem too, had an out-of-date ~/.sbt/repositories file.
Either:
remove or rename ~/.sbt/repositories
add missing repositories to ~/.sbt/repositories from the current repositories list, see https://github.com/sbt/sbt/blob/v1.0.2/launch/src/main/input_resources/sbt/sbt.boot.properties
Upgrade your SBT version
Create a new user, to have a clean configuration, make sure that it is available for this user JDK and SBT with a "-version". I executed it and everything worked perfectly. Sometimes you have both installed or configured for your user that the programs conflict with each other.
P.S. I do not recommend using openjdk in this case.

Scalc SBT compile failing

I am trying to follow code from below link
http://spark.apache.org/docs/latest/quick-start.html
But when I am trying to create package it is failing. I want to know 2 thinks
obviously, why it is failing
why it is showing older version of the scala, while I mentioned 2.11
Below is the error message.
[info] Set current project to default-0464ce (in build file:/home/ubuntu/simple_sbt/)
[info] Updating {file:/home/ubuntu/simple_sbt/}default-0464ce...
[info] Resolving org.scala-lang#scala-library;2.9.1 ...
[info] Done updating.
[info] Compiling 1 Scala source to /home/ubuntu/simple_sbt/target/scala-2.9.1/classes...
[error] /home/ubuntu/simple_sbt/src/main/scala/SimpleApp.scala:1: object apache is not a member of package org
[error] import org.apache.spark.SparkContext
[error] ^
[error] /home/ubuntu/simple_sbt/src/main/scala/SimpleApp.scala:2: object apache is not a member of package org
[error] import org.apache.spark.SparkContext._
[error] ^
[error] two errors found
[error] {file:/home/ubuntu/simple_sbt/}default-0464ce/compile:compile: Compilation failed
[error] Total time: 2 s, completed Aug 30, 2016 3:19:18 AM
when you run sbt package , sometimes it fails as there are no dependencies that are downloaded and will be resolved for the files imported.
Try running, sbt run first and then sbt package . sbt run should bring in all the dependencies on top of which packaging and compiling will be possible.
If the above does not solves your problem, you need to share your sbt build file and the environment that you are using. In which directory you are running these commands, will also play a role.

How can I enable remote debugging for SBT in windows?

I would like to accomplish running the equivalent of this
sbt -jvm-debug 5005
However I don't seem to be able to pass in args in Windows. This is what I am seeing
>sbt -jvm-debug 5005
[info] Loading project definition from [myProject]
[info] Set current project to [myProject] (in build file myProject)
[error] Expected letter
[error] Expected symbol
[error] Expected '!'
[error] Expected '+'
[error] Expected '++'
[error] Expected ';'
[error] Expected end of input.
[error] Expected 'show'
[error] Expected '*'
[error] Expected '{'
[error] Expected project ID
[error] Expected configuration
[error] Expected key
[error] 5005
[error] ^
[error] Not a valid command: jvm-debug
[error] Not a valid project ID: jvm-debug
[error] Expected ':' (if selecting a configuration)
[error] Not a valid key: jvm-debug
[error] jvm-debug
[error] ^
I would like to be able to remote debug this application from Intellij. Any help would be great!
set SBT_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005
sbt run
was the only working solution on Windows 7.
Seems like the Windows version of SBT doesn't define this functionality.
On Linux it is defined in the $SBT_HOME/sbt/bin/sbt-launch-lib.bash as
addDebugger () {
addJava "-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=$1"
}
You can achieve the same result by setting the SBT_OPTS environmental variable on Windows.
Run SBT like this, to make the debugger listen on port 5005
set SBT_OPTS="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005" && sbt
Currently, I'd downloaded the last updated sbt, exactly sbt 1.3.3 but when I want to enable debug in the project, I had the same problem as you. Investigating, I could see that I haven't this file (sbt-launch-lib.bash) in my own root C:\Program Files (x86)\sbt\bin so when I see in another machine, I could notice that sbt, It was 1.2.8 and yes it had the file that I mentioned before so I uninstalled sbt 1.3.3 and I installed sbt 1.2.8 and put in my project sbt -jvm-debug 9999 and it works.