Skip to content

Running Scala

February 23, 2015

As mentioned earlier, using the Scala – IDE for running the program. But how we can run it from the command line was the question and using the following steps, one can run their Scala program. Please note, the following sequence needs Scala-IDE! In the following example, i’m casbah for MongoDB!

Following is the package structure of the firstTrial project.

scalarun-1

Click on the export in the File menu and following window will be displayed

scalarun-2

scalarun-3

Use the jar file and set the classpath.

Set classpath=h:\mongo-java-driver-2.13.0.jar;h:\slf4j-api-1.7.10.jar;h:\slf4j-log4j12-1.7.10.jar;h:\log4j-1.2.17.jar;h:\log4j-core-2.1.jar;h:\scala-library-2.11.5.jar;h:\json4s-core_2.11-3.2.11.jar;h:\paranamer-2.5.6.jar;h:\json4s-native_2.11-3.2.11.jar;h:\casbah-commons_2.11-2.8.0.jar;h:\casbah-core_2.11-2.8.0.jar;h:\casbah-gridfs_2.11-2.8.0.jar;h:\casbah-query_2.11-2.8.0.jar;C:\Users\Jagannathan\Downloads\scala-library.jar;C:\Users\Jagannathan\Desktop\firstTrial.jar;%CLASSPATH%;.

Run the program as

Java com.jagan.myscala.package

You will get the output!

Will write more details in the next post.

Advertisements
No comments yet

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: