Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running Main #2

Closed
tindzk opened this issue Dec 27, 2014 · 3 comments
Closed

Running Main #2

tindzk opened this issue Dec 27, 2014 · 3 comments

Comments

@tindzk
Copy link

tindzk commented Dec 27, 2014

It seems like all source files are compiled properly, but sbt fails to find the Main class.

$ sbt run
[info] Loading project definition from /tmp/scalajs-cross-project-intellij/project
[info] Set current project to scalajs-cross-project-intellij (in build file:/tmp/scalajs-cross-project-intellij/)
[warn] No main class detected
java.lang.RuntimeException: No main class detected.
        at scala.sys.package$.error(package.scala:27)
[trace] Stack trace suppressed: run last scalajs-cross-project-intellij/compile:run for the full output.
[error] (scalajs-cross-project-intellij/compile:run) No main class detected.
[error] Total time: 0 s, completed 2014-12-27 20:15:52
@vmunier
Copy link
Owner

vmunier commented Dec 28, 2014

Hi @tindzk,
To run the js app, you need to do:

$ sbt
> project exampleJS
> run

To run the jvm app, you need to do:

$ sbt
> project exampleJVM
> run

This repository was meant to show how you could integrate a Cross Project with IntelliJ.
The app itself, and running it, is very secondary.
But I will add a few lines in the README to say how to run it.

@tindzk
Copy link
Author

tindzk commented Dec 28, 2014

Perfect, thank you. Is it also possible to run it directly in IntelliJ? There is an error indicating that the class couldn't be found even though IntelliJ detects Main as being executable.

@vmunier
Copy link
Owner

vmunier commented Dec 28, 2014

To run the jvm app in IntelliJ, right click on the jvm's Main file and then Run 'Main'.
I don't know how you could run the js's Main in IntelliJ. Maybe it could be run with Node.js in IntelliJ.

Personally I always use sbt to run the js app.

@tindzk tindzk closed this as completed Dec 28, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants