The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

CElliott (12) [Avatar] Offline
#1
I am trying to complete the exercises at the end of Chapter 2; I need the HelloWorldFigaro example as the starting point, as per the first exercise. I have unzipped the PPP_SourceCode14.zip file. According to Appendix A, all I have to do is to navigate to the PracticalProbProg/examples directory and type:

sbt console
sbt "runMain chap01.HelloWorldFigaro"

I have typed every conceivable combination of the above characters and all I see are errors. I have been at this for over an hour and a half with no results. Here is the output:

E:
17:26 Fri 02/12 E:\>cd E:\Development\PPP_SourceCode14\PracticalProbProg\examples
17:26 Fri 02/12 E:\Development\PPP_SourceCode14\PracticalProbProg\examples>sbt console
Java HotSpot(TM) Client VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0
[info] Loading project definition from E:\Development\PPP_SourceCode14\PracticalProbProg\examples\project
[info] Updating {file:/E:/Development/PPP_SourceCode14/PracticalProbProg/examples/project/}examples-build...
[info] Resolving org.fusesource.jansi#jansi;1.4 ...
[info] Done updating.
[info] Compiling 1 Scala source to E:\Development\PPP_SourceCode14\PracticalProbProg\examples\project\target\scala-2.10\sbt-0.13\classes...
[info] Set current project to Examples (in build file:/E:/Development/PPP_SourceCode14/PracticalProbProg/examples/)
[info] Updating {file:/E:/Development/PPP_SourceCode14/PracticalProbProg/examples/}Examples...
[info] Resolving jline#jline;2.12.1 ...
[info] Done updating.
[info] Compiling 36 Scala sources and 1 Java source to E:\Development\PPP_SourceCode14\PracticalProbProg\examples\target\scala-2.11\classes...
[info] Starting scala interpreter...
[info]
Welcome to Scala version 2.11.6 (Java HotSpot(TM) Client VM, Java 1.8.0_66).
Type in expressions to have them evaluated.
Type :help for more information.

scala> sbt "runMain chap01.HelloWorldFigaro"
<console>:1: error: ';' expected but string literal found.
sbt "runMain chap01.HelloWorldFigaro"

I have typed this with quotes, without quotes, with package name, without package name, etc., etc., etc., etc., etc.....
Nothing works; there are nothing but errors.
I also tried all of this with PPP_SourceCode13.zip. Same result; nothing but errors.

What is the problem? Is there some alternative way to get at the HelloWorld example?


95955 (1) [Avatar] Offline
#2
Sbt tasks can be run at the console or from the command-line.

If you run from the console (as you have) just type

runMain chap01.HelloWorldFigaro

If you run from the command-line then prefix with sbt, ie:

sbt runMain chap01.HelloWorldFigaro