File not found exception

18 views
Skip to first unread message

Madhav

unread,
Sep 23, 2009, 3:50:18 AM9/23/09
to Maven and Scala
Hi all
I am getting an error while running mvn exec:java on sjson package

An exception occured while executing the Java class. sjson.json.Driver

and on running with stacktrace on it shows
caused by
java.lang.ClassNotFoundException: sjson.json.Driver
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:283)
at java.lang.Thread.run(Thread.java:619)

I am new to maven and scala both so any ideas ???

regards
Madhav

David Bernard

unread,
Sep 23, 2009, 4:05:22 AM9/23/09
to maven-a...@googlegroups.com
Hi,

sjson.json.Driver is compiled (present under target/classes) ?

FYI: an alternative to exec:java if you use the maven-scala-plugin is
the run goal
mvn scala:run -DmainClass=sjson.json.Driver
see http://scala-tools.org/mvnsites/maven-scala-plugin/usage_run.html

/davidB

Madhav

unread,
Sep 23, 2009, 6:31:02 AM9/23/09
to Maven and Scala
hi
nopes sjson.json.Driver is nt in target/classes ...
which step am i missing ?????
Thanks for quick reply :)

On Sep 23, 1:05 pm, David Bernard <david.bernard...@gmail.com> wrote:
> Hi,
>
> sjson.json.Driver is compiled (present under target/classes) ?
>
> FYI: an alternative to exec:java if you use the maven-scala-plugin is
> the run goal
> mvn scala:run -DmainClass=sjson.json.Driver
> seehttp://scala-tools.org/mvnsites/maven-scala-plugin/usage_run.html
>
> /davidB

David Bernard

unread,
Sep 23, 2009, 6:37:55 AM9/23/09
to maven-a...@googlegroups.com
at least
"mvn compile" if your .scala is under src/main/scala
"mvn test-compile" if your .scala is under src/test/scala

David Bernard

unread,
Sep 23, 2009, 6:39:48 AM9/23/09
to maven-a...@googlegroups.com
Hi,

In my projects, I put some dry Main under src/test/scala/sandbox
To run them I used :
mvn test-compile scala:run -DmainClass=sandbox.MyMain

/davidB

Madhav

unread,
Sep 23, 2009, 7:23:49 AM9/23/09
to Maven and Scala
hey it works now:) !
but still i can't see sjson.json.Driver in target/class ..

Thnx for helping out




On Sep 23, 3:39 pm, David Bernard <david.bernard...@gmail.com> wrote:
> Hi,
>
> In my projects, I put some dry Main under src/test/scala/sandbox
> To run them I used :
> mvn test-compile scala:run -DmainClass=sandbox.MyMain
>
> /davidB
>
> On Wed, Sep 23, 2009 at 12:37, David Bernard <david.bernard...@gmail.com> wrote:
> > at least
> > "mvn compile" if your .scala is under src/main/scala
> > "mvn test-compile" if your .scala is under src/test/scala
>
Message has been deleted

Josh Suereth

unread,
Sep 23, 2009, 9:15:44 AM9/23/09
to maven-a...@googlegroups.com
it goes in target/test-classes
Reply all
Reply to author
Forward
0 new messages