开发者

how to create (or run) .jar file from .scala files?

There's an open source program called CIMCheck (http://wiki.cimtool.org/CIMCheck.html) that is supposed to be a command line utility which is run with command

    java -jar cimcheck.jar [option...] argument1 argument2

When I downloaded the source code, there was no .jar files at all, only a couple of .scala files and others.

So I have a following directory tree

   CIMCheck 
          -.classpath
          -.gitignore
          -.project
          -CIMCheck.launch
          -CIMCheck.xml
          -scaladoc.sh

          lib
              -scala-library.jar
          src
             au
               com
                  langdale
                           cimcheck
                                   -Checker.scala
                        开发者_C百科           -CIMCheck.scala
                           util
                                   -CommandLine.scala

prefix "-" means it's a file; whereas, names without prefix are folders.

I've downloaded Scala, and tried to compile/run mentioned .scala files with scala compiler/interpreter but there are some mistakes at compiling/running a files.

i tried runing scaladoc.sh as a shell script in cygwin on windows, but no success. I guess I need to run only CIMCheck.scala, as a .jar but don't know how If you need the code from the *.scala files, let me know, and I'll repost.

Cheers


This should work:

  1. In the Eclipse menu, select File > Export > Runnable JAR file, select the CIMCheck launch configuration, and check the "Save as ANT script" option.
  2. Check if the output file includes scala-library.jar. If not, add it to the script created on the last step and rerun it.


The fact that you have a .project and .classpath file in there indicates that this is probably an Eclipse project. Try opening it in Eclipse (you'll have to File / Import / Existing project into workspace).


I can't access http://git.cimtool.org/ right now but I would guess that there would be a readme or so about buildihe project. I see on the CIMCheck website mention of using Eclipse, so perhaps there is an Eclipse project included and you are excepted to build CIMCheck via the IDE?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜