charles-river-analytics / figaro

Figaro Programming Language and Core Libraries
Other
756 stars 151 forks source link

Versions #727

Open toncho11 opened 6 years ago

toncho11 commented 6 years ago

What versions does Figaro 5.0 require?

scala 2.12.4 ? jvm 1.8.0.144 ?

I am having some problems:

Exception in thread "main" java.lang.NoSuchMethodError: scala.Product.$init$(Lscala/Product;)V at com.cra.figaro.language.Name.(Reference.scala:28) at com.cra.figaro.language.Name$.stringToName(Reference.scala:64) at Simulator$.(Simulator.scala:11) at Simulator$.(Simulator.scala) at Simulator.main(Simulator.scala)

It compiles, but it does not run.

mreposa commented 6 years ago

Figaro 5.0.0.0 cross-compiles to support both Scala 2.11.8 and 2.12.2 using Java 1.8.

mreposa commented 6 years ago

The stack trace is helpful, but if it's possible to post the code you're trying to run we'll be able to tell you more because we can attempt to reproduce the problem on our side and debug.

toncho11 commented 6 years ago

Cross-compiles? It is two different fat-jars?

toncho11 commented 6 years ago

I got the problem with Figaro 5.0, Scala 2.12 and IntelliJ:

1) Install Scala 2.12.x within Intellij from File->Project structure->Global Libraries and click on the "+". If you do not find version 2.12 in the list then you need to install it manually from the Scala web-site (Download the Scala binaries for windows). Next you need to point to this installation from the IntelliJ UI after you clicked on the "+".

Unfortunately that does not change the designated SDK for your current project. So you need to:

2) Re-import your project. Select overwrite every time. Then click on a scala source file and at the top you will be asked to select the Scala SDK. Select 2.12.x. This version will be fixed until you re-import.

3) Go to File->Project structure->Modules->Dependencies and click on the "+". Select the Figaro 5.0 fat jar file.

4) For Run Configuration use "Application", not "Scala script"

5) You can use:

println(util.Properties.versionString) to see which version of Scala you are using.