hello from a cygwin user

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

hello from a cygwin user

invitro
Hi, I found this book a couple of months ago, but just started the projects yesterday.  I read a lot -- hundreds of books a year, non-fiction and fiction -- and this book is one of the most amazingly good books I've ever read.  I may be biased in that it suits my wants perfectly: I am a Perl programmer and have started programming C, and trying to learn about the insides of a computer, and the comp.sci. textbooks on computer structure help some, but not too much.  TECS is perfect.  And the project aspect is perfect too, as I love making things on computer, trying them out and debugging, learning and getting something working.

Thank you so much Profs. Nisan & Schocken, and @cadet1620, for writing this book and its software, and keeping this forum running (11 years after the book was published)!  I often feel pessimistic about education these days, but this project has me feeling good about at least computer science in Israel.

I am a cygwin user (and lover) on a Win 7 system.  I greatly prefer command-line tools, but had some trouble getting the Hardware Simulator to work on cygwin:

[~/nand2tetris-noam-nisan/tools]$ ./HardwareSimulator.sh ../projects/01/Xor.tst
Error: Could not find or load main class HardwareSimulatorMain

I tried a variety of things, and seemed to be getting closer by using some variations of:

[~/nand2tetris-noam-nisan/tools]$ ^Cygdrive/c/Windows/System32/cmd.exe /c start 'clean shell' /I 'C:\Windows\explorer.exe' 'C:\cygwin\home\Lane\nand2tetris-noam-nisan\tools\HardwareSimulator.bat "C:\cygwin\home\Lane\nand2tetris-noam-nisan\projects\01\Xor.tst"'

but this just gave different errors, and was a dead end.

(Quick note: I don't expect cygwin to be supported, as it's pretty rare, and I don't think I had trouble getting the Hardware Simulator GUI to work from HardwareSimulator.bat).

I eventually got these commands to work:

[~/nand2tetris-noam-nisan]$ cd tools
[~/nand2tetris-noam-nisan/tools]$ java -classpath ".;bin/classes;BuiltIn;bin/lib/Hack.jar;bin/lib/HackGUI.jar;bin/lib/Simulators.jar;bin/lib/SimulatorsGUI.jar;bin/lib/Compilers.jar" HardwareSimulatorMain ../projects/01/Xor.tst
End of script - Comparison ended successfully

The only difference between this command and the one in HardwareSimulator.sh is that the classpath directories are separated by ':' in it, and by ';' in my working command.  Geez!

I'm putting this stuff in my post here in case another cygwin user tries out this software and has a similar problem.

I've got all the Chapter 1 projects done except Mux8Way16.hdl, which I'm working on right now.  I just wanted to take a break and make a quick post before I forget :).

Reply | Threaded
Open this post in threaded view
|

Re: hello from a cygwin user

cadet1620
Administrator
invitro wrote
The only difference between this command and the one in HardwareSimulator.sh is that the classpath directories are separated by ':' in it, and by ';' in my working command.  Geez!
I just did a bit of searching.  If you need to write scripts that will run on both Linux and Cygwin here's a post that shows how to detect Cygwin and set path separator.
    http://stackoverflow.com/questions/936662/is-there-a-way-to-use-cygwin-to-run-shell-scripts-and-use-proper-path-seperators.

--Mark