Jack Compiler

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

Jack Compiler

I'm having trouble running JackCompiler.sh.  I'm using a computer running Ubuntu-Linux.  The Hardware Simulator and the CPU Simulator both work but when I click on JackCompiler.sh nothing happens. No window shows up.  I tried the option of running the program using the terminal but all that happened was the terminal window opened and closed immediately.
The directions (pg 197, softcover) say to "apply the compiler to the name of the program directory".  Does that mean I should be doing something other than trying to run the JackCompiler.sh file?
Reply | Threaded
Open this post in threaded view

Re: Jack Compiler

Run the JackCompiler.sh script from the command line and read the output:

Jack Compiler, Version 2.5

This program is part of the software suite that accompanies the book:

The Elements of Computing Systems
by Noam Nisan and Shimon Schocken
MIT Press, 2005
Book site: www.idc.ac.il/tecs

Software Architects: Yaron Ukrainitz and Yannai A. Gonczarowski

Usage instruction and tips can be found in the relevant book chapters.

Usage: java JackCompiler <Jack-dir or Jack-file-name>
Reply | Threaded
Open this post in threaded view

Re: Jack Compiler

Not being familiar with DOS, it took me quite a while to figure out how to use the JackCompiler.
So I hope the following will be of help to people.
I am working on a Windows machine with XP as the operating system
First of all unlike the HardwareSimulator, CPUEmulator, Assembler etc it won't do just to double click on the relevant .bat file.
All that will happen is the console window will appear momentarily and then vanish.
Instead follow the steps in the pic below
JackCompiler steps

Click on the OK button and the compiler does its job. There is no GUI for the compiler
so it's only the creation of the vm files that tells you it's worked.

EDIT: AFAIK if you're using vista there's no 'run' button.
        I think you just need to click on the equivalent of the start button (again in the bottom right corner
        of the screen) and enter the text as above in the textbox control that then appears (just above the
        'start' button)
Reply | Threaded
Open this post in threaded view

Re: Jack Compiler

Josh Nahum
I'm in the same boat. Culchie's suggestion works on Windows (using the JackCompiler.bat) but on a Mac, I am having trouble.

Using the command "bash JackCompiler.sh", I get the instruction screen ("Jack Compiler, Version 2.5 ...  Usage: java JackCompiler <Jack-dir or Jack-file-name>").

Performing "java JackCompiler ./" yields a "Exception in thread "main" java.lang.NoClassDefFoundError: JackCompiler ... " error.

I have java version "1.6.0_22", so I don't know what I'm doing wrong.

Other than that great job, I've got to Chapter 9 on my own so far. Big Fan.

For those interested the full exception information:

d-172-25-253-176:project 09 joshnahum$ java -version
java version "1.6.0_22"
Java(TM) SE Runtime Environment (build 1.6.0_22-b04-307-10M3261)
Java HotSpot(TM) 64-Bit Server VM (build 17.1-b03-307, mixed mode)

d-172-25-253-176:project 09 joshnahum$ java JackCompiler ./Square
Exception in thread "main" java.lang.NoClassDefFoundError: JackCompiler
Caused by: java.lang.ClassNotFoundException: JackCompiler
        at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:248)