GithubHelp home page GithubHelp logo

Comments (12)

eed3si9n avatar eed3si9n commented on July 23, 2024

It should be included by default. Could you create gist of your build.sbt?

from sbt-assembly.

odwrotnie avatar odwrotnie commented on July 23, 2024

https://gist.github.com/1933146

from sbt-assembly.

eed3si9n avatar eed3si9n commented on July 23, 2024

I don't see anything wrong with it. Are you able to run your app using run task?

from sbt-assembly.

odwrotnie avatar odwrotnie commented on July 23, 2024

Yes, it works great ;).

from sbt-assembly.

odwrotnie avatar odwrotnie commented on July 23, 2024

I am using class Main extends App { ... }, could it be the problem?

from sbt-assembly.

eed3si9n avatar eed3si9n commented on July 23, 2024

In my environment using class Main extends App { ... } raises:

Failed to load Main-Class manifest attribute from
xyz.jar

but using object Main extends App { ... } works.

from sbt-assembly.

eed3si9n avatar eed3si9n commented on July 23, 2024

Does it print out:

[info] Including scala-library.jar

when you run assembly?

from sbt-assembly.

odwrotnie avatar odwrotnie commented on July 23, 2024

Sorry, it is object Main extends App { ... }.

from sbt-assembly.

odwrotnie avatar odwrotnie commented on July 23, 2024

No, it does not print out [info] Including scala-library.jar.

from sbt-assembly.

eed3si9n avatar eed3si9n commented on July 23, 2024

Is it possible for you to zip up the project and email it to me, or create some other reproducible sample that you can share?

from sbt-assembly.

odwrotnie avatar odwrotnie commented on July 23, 2024

This is the sample: https://github.com/odwrotnie/hello-swt.
I think it runs now but ignores this settings:

javaOptions := Seq("-XstartOnFirstThread", "-d64"),
fork := true,

./sbt run works.

from sbt-assembly.

eed3si9n avatar eed3si9n commented on July 23, 2024

I grabbed your code, ran assembly from sbt:

Main> assembly
[info] Updating {file:/Users/foo/work/quick-demo/hello-swt/}Main...
[info] Resolving org.scala-lang#scala-library;2.9.1 ...
[info] Done updating.
[info] Compiling 1 Scala source to /Users/foo/work/quick-demo/hello-swt/main/target/scala-2.9.1/classes...
[info] No tests to run for test:test
[info] Including swt.jar
[info] Including scala-library.jar
[info] Packaging /Users/foo/work/quick-demo/hello-swt/main/target/Main-assembly-0.1.jar ...
[info] Done packaging.
[success] Total time: 7 s, completed Mar 3, 2012 8:33:28 AM

As you can see, it does print out [info] Including scala-library.jar to the shell.
Next, I exited sbt, and ran the created jar as follows:

$ java -jar main/target/Main-assembly-0.1.jar
***WARNING: Display must be created on main thread due to Cocoa restrictions.
Exception in thread "main" org.eclipse.swt.SWTException: Invalid thread access
    at org.eclipse.swt.SWT.error(Unknown Source)
    at org.eclipse.swt.SWT.error(Unknown Source)
    at org.eclipse.swt.SWT.error(Unknown Source)
    at org.eclipse.swt.widgets.Display.error(Unknown Source)
    at org.eclipse.swt.widgets.Display.createDisplay(Unknown Source)
    at org.eclipse.swt.widgets.Display.create(Unknown Source)
    at org.eclipse.swt.graphics.Device.<init>(Unknown Source)
    at org.eclipse.swt.widgets.Display.<init>(Unknown Source)
    at org.eclipse.swt.widgets.Display.<init>(Unknown Source)
    at Main$delayedInit$body.apply(main.scala:7)
    at scala.Function0$class.apply$mcV$sp(Function0.scala:34)
    at scala.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:12)
    at scala.App$$anonfun$main$1.apply(App.scala:60)
    at scala.App$$anonfun$main$1.apply(App.scala:60)
    at scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:59)
    at scala.collection.immutable.List.foreach(List.scala:45)
    at scala.collection.generic.TraversableForwarder$class.foreach(TraversableForwarder.scala:30)
    at scala.App$class.main(App.scala:60)
    at Main$.main(main.scala:5)
    at Main.main(main.scala)

The App is running. Whatever that's going on inside App is throwing the error.
So I simplified the application to just println.

hello

from sbt-assembly.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.