question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Scala runner doesn't do executable jars

See original GitHub issue

Compiler version

3.0.0

Minimized code

➜  snips sdk use scala 2.13.6

Using scala version 2.13.6 in this shell.
➜  snips scalac -d hi.jar hi.scala
➜  snips scala hi.jar
hello, world
➜  snips sdk use scala 3.0.0

Using scala version 3.0.0 in this shell.
➜  snips scalac -d hi.jar hi.scala
➜  snips scala hi.jar
Error: Could not find or load main class hi.jar
Caused by: java.lang.ClassNotFoundException: hi.jar
➜  snips scala -classpath hi.jar Main
hello, world

Output

Error: Could not find or load main class hi.jar

Expectation

Scala runner creates and runs an executable jar. It looks like it doesn’t create META-INF/MANIFEST.MF.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:11 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
dwijnandcommented, Jul 27, 2021

Overlaps with #13081, so either make sure to coordinate with @BarkingBad.

0reactions
anatoliykmetyukcommented, Aug 5, 2021

Yes, we discussed whether we should go Python-style or tolerate @main in scripts earlier. The argument for @main was not only simplicity but also the ability to accept command arguments in a natural way. Another argument was that scripts and programs ideally should be the same thing; we should strive to avoid differentiating between the two. Overall we got the consensus that @main in scripts is fine.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Problem creating an executable jar from scala file
I'm tryign to export my project as a jar with IntelliJ 9.0. My project compiles and runs with no problem in Intellij, but...
Read more >
How to deploy a single, executable Jar file (sbt-assembly)
A JAR file created by SBT can be run by the Scala interpreter, but not the Java interpreter. This is because class files...
Read more >
How to run a Jar file | TechTarget - TheServerSide.com
Steps to run a JAR file on Windows, Mac or Linux · Verify that Java is installed on your computer · Confirm the...
Read more >
How to Make Executable JAR file in Eclipse IDE - Java - Java67
After creating an executable JAR file, you can follow these steps to run the Java program ... All you need to do is...
Read more >
Java Rules | Bazel
Non-executable binaries collect transitive runtime Java dependencies into a deploy jar, but cannot be executed directly. No wrapper script is created if this ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found