 ClassFile = require '../src/class_file'
 methods = require '../src/methods'
 
+classpath = [ ".", "#{__dirname}/../third_party/classes" ]
+
 exports.read_binary_file = (filename) ->
   return null unless path.existsSync filename
   util.bytestr_to_array fs.readFileSync(filename, 'binary')
 
 exports.read_classfile = (cls) ->
-  classpath = [ ".", "#{__dirname}/../third_party/classes" ]
   for p in classpath
     data = exports.read_binary_file "#{p}/#{cls}.class"
     return new ClassFile data if data?

  {argv} = optimist

  optimist.usage '''
  Usage: $0 /path/to/classfile
    --java=[args for JVM]
    [--log=[0-10]|debug|error]
    [--profile]

      resume data

  rs = new runtime.RuntimeState(stdout, read_stdin, exports.read_classfile)

  if argv.profile
    timings = {}
    call_counts = {}
