Haixu Huang
Posts: 6
Nickname: regular
Registered: Oct, 2008
|
|
Re: Is there a way to "export" the compiled class files into runnable jar?
|
Posted: Dec 29, 2008 4:42 PM
|
|
OK, maybe it's too simple to reply it. I now give an answer for it. I use Eclipse. First, create a small entrance class, with the "main" method.
package scala.loader;
import java.util.*;
public class Test
{
public static void main(String[] args) {
List<String> argList = new ArrayList<String>();
argList.add("scala.main.object.name");
for (String s : args) argList.add(s);
scala.tools.nsc.MainGenericRunner.main(argList.toArray(new String[0]));
}
}
Second, be sure to set the class path of .../scala.tools.nsc_2.7.?.jar In eclipse, it maybe exists in plugins/ directory.
Third, in eclipse, export to the runnable jar. The main class is the class we created in first step.
That's all.
I take reference of Scala's scala.bat file.
|
|