Currently trying to build and run the code for Chapter 4.
So far I have installed the prerequisites and got as far as: make java_chapters.
I can see the code under /gen/chap04_scanning/com/craftinginterpreters/lox/
I can see the compiled .class files under /build/gen/chap04_scanning/com/craftinginterpreters/lox/
However I am now not sure what to do with the files produced from the build output. Can I run Lox.class with java somehow?
I am using Linux. Although I have a good understanding of C and C++, including build systems like CMake, I haven't used Java for years, so I really don't know what I am doing.
I have managed to compile and run a version of Hello World in Java, which I did by first building the Main.java file with javac and then running the Main.class file with java Main.
But it seems this doesn't work with the file Lox.class. I am not sure why exactly, but I believe it relates to the fact that packages are being used, whereas I don't use this in my < 10 line Hello World example.
Can anyone point me in the right direction? Thanks
Currently trying to build and run the code for Chapter 4.
So far I have installed the prerequisites and got as far as:
make java_chapters
.I can see the code under
/gen/chap04_scanning/com/craftinginterpreters/lox/
I can see the compiled
.class
files under/build/gen/chap04_scanning/com/craftinginterpreters/lox/
However I am now not sure what to do with the files produced from the build output. Can I run
Lox.class
withjava
somehow?I am using Linux. Although I have a good understanding of C and C++, including build systems like CMake, I haven't used Java for years, so I really don't know what I am doing.
I have managed to compile and run a version of Hello World in Java, which I did by first building the
Main.java
file withjavac
and then running theMain.class
file withjava Main
.But it seems this doesn't work with the file
Lox.class
. I am not sure why exactly, but I believe it relates to the fact that packages are being used, whereas I don't use this in my < 10 line Hello World example.Can anyone point me in the right direction? Thanks