たとえば、にある eclipse プロジェクトがあるとしD:\DanHenderson\scala\MyProjectます。MyProject には、 と の 2 つのディレクトリがsrcありbinます。srcI have scala code自体では、それはいくつかのクラスまたはアプリケーションである可能性があります。では、これらのクラスを使用したり、コマンドラインからアプリケーション全体を実行するにはどうすればよいでしょうか? つまり、 class のファイルがあり、コマンドラインに入力Aできるようにしたいのです。val a = new Aこれどうやってするの?
1 に答える
1
By command line I assume you mean the Scala REPL. Add the directory of your class files to the classpath when starting the Scala REPL:
scala -classpath "path to some dir where your .class files reside"
Note that if your project relies on some libraries then those need to be on the classpath as well.
于 2012-08-12T21:59:28.387 に答える