jamr icon indicating copy to clipboard operation
jamr copied to clipboard

Instruction of Successfully Installing JAMR by Updating Packages

Open longxudou opened this issue 5 years ago • 3 comments

Reason of Failure

The original JAMR was installed in 2015 or 2016 in the server, thus some packages were broken or not updated. The default setup script in JAMR repos is set to a version no longer available. I have installed JAMR again on my Macbook (Mojave 10.14.6) and uploaded a new version in JAMR and share the details as following.

Install Pipeline

First, please ensure the following env: JAVA=8.0 (Download from oracle website) sbt=1.0.2, scala=2.11.8 (Use SDKMAN! to install, like sdk install scala 2.11.8 )

Then, modify these files:

  • jamr/project/build.properties:

sbt.version=1.0.2

  • jamr/build.sbt:

// import AssemblyKeys._ // assemblySettings name := "jamr" version := "0.1-SNAPSHOT" organization := "edu.cmu.lti.nlp" scalaVersion := "2.11.8" crossScalaVersions := Seq("2.11.8","2.11.12", "2.12.4","2.10.6") libraryDependencies ++= Seq( "com.jsuereth" %% "scala-arm" % "2.0", "edu.stanford.nlp" % "stanford-corenlp" % "3.4.1", "edu.stanford.nlp" % "stanford-corenlp" % "3.4.1" classifier "models", "org.scala-lang.modules" %% "scala-parser-combinators" % "1.1.2", "org.scala-lang.modules" %% "scala-pickling" % "0.10.1" // "org.scala-lang" % "scala-swing" % "2.10.3" )

  • jamr/project/plugins.sbt:

resolvers += "Sonatype releases" at "https://oss.sonatype.org/content/repositories/releases" resolvers += "Sonatype snapshots" at "https://oss.sonatype.org/content/repositories/snapshots/" addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.6") // addSbtPlugin("com.github.mpeltonen" % "sbt-idea" % "1.6.0") addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "5.2.4")

PS: sbt-idea plugin had been unsupported since it was included into official Scala plugin about two years ago, and project files generated by outdated version of the plugin are not compatible with IntelliJ IDEA starting with version 14, if I recall correctly.

Finally, update the scala version in the CLASSPATH env variable in scripts/config.sh (Thanks @danielhers and @zhangzx-sjtu for pointing this.)

export CLASSPATH=".:${JAMR_HOME}/target/scala-2.11/jamr-assembly-0.1-SNAPSHOT.jar"

After doing the above, install JAMR by.

. scripts/config.sh ./setup

Troubleshooting

  1. JAVA is inconsistent with Scala as mentioned in issue. Just install scala with 2.11.12 version and modified the corresponding lines in jamr/build.sbt and java/scripts/config.sh
  2. Run sbt before running ./setup in the JAMR directory if the problem raises.

Acknowledgement

Thanks @LeonardoEmili for giving us a good summary https://github.com/jflanigan/jamr/issues/43#issuecomment-981128400 on success setup and created a PR on this issue. This issue was originated by issue under CoNLL2019 shared task and @danielhers gave many suggestions.

longxudou avatar Feb 13 '20 19:02 longxudou

Good idea to use new versions of scala and sbt. Just to add that if we use scala 2.11.x (instead of 2.10.x), we should also do the following change in scripts/config.sh:

export CLASSPATH=".:${JAMR_HOME}/target/scala-2.11/jamr-assembly-0.1-SNAPSHOT.jar"

We should change the scala folder name in CLASSPATH from scala-2.10 to scala-2.11, otherwise we will encounter the error "edu.cmu.lti.amr.CorpusTool not found" when running the aligner. I wasted a lot of time on this silly directory error, so I mark a note here for other people's convenience :)

zhangzx-sjtu avatar Nov 01 '20 05:11 zhangzx-sjtu

Good idea to use new versions of scala and sbt. Just to add that if we use scala 2.11.x (instead of 2.10.x), we should also do the following change in scripts/config.sh:

export CLASSPATH=".:${JAMR_HOME}/target/scala-2.11/jamr-assembly-0.1-SNAPSHOT.jar"

We should change the scala folder name in CLASSPATH from scala-2.10 to scala-2.11, otherwise we will encounter the error "edu.cmu.lti.amr.CorpusTool not found" when running the aligner. I wasted a lot of time on this silly directory error, so I mark a note here for other people's convenience :)

I met the same problem. However, changing the directory (from 2.10 to 2.11) seems not worked for me? Is there any other suggestions? THX

311dada avatar Nov 07 '20 12:11 311dada

Thank you @DreamerDeo for sharing it, you saved my day!

LeonardoEmili avatar Nov 28 '21 15:11 LeonardoEmili