Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6563483
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T13:51:27+00:00 2026-05-25T13:51:27+00:00

I have a Swing app written in Scala in a .jar file. I made

  • 0

I have a Swing app written in Scala in a .jar file. I made a desktop shortcut with the command scala "filepath\filename.jar" which works, except it brings up a command window first which sits in the background until I close the application. I want to make this go away.

I believe for Java you’re supposed to use javaw instead of java for this purpose. I tried copying the scala.bat file to a new file called scalaw.bat to and changing line 24 to

if exist "%JAVA_HOME%\bin\javaw.exe" set "_JAVACMD=%JAVA_HOME%\bin\javaw.exe" 

and line 28 to

if "%_JAVACMD%"=="" set _JAVACMD=javaw

but (after updating the desktop shortcut) I’m still getting the command window coming up. Any ideas?


Update: I tried adding scala-library.jar to the manifest but it doesn’t work, I guess because paths are relative to the jar’s root. Other option seems to be include the whole scala-library jar within the jar file (Creating a jar file from a Scala file), but I don’t consider that a solution.

Or I can unpack the jar to its constituent .class files and use the shortcut

javaw.exe -cp "%SCALA_HOME%/lib/scala-library.jar";"filepath\\" packageName.className

but … that involves unpacking the jar.

Another semi-workaround Ive found is to edit the shortcut so that it the command window runs minimized.


Solution: as per eugener’s answer, you need to use javaw without the -jar option, but specifying the jar-file e.g.

javaw -cp "%SCALA_HOME%/lib/*";"C:/path/yourjar.jar" packageName.className

If it’s a Swing app and you use the scala-swing library you’ll need to include that as well, or use the * wildcard as above.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T13:51:27+00:00Added an answer on May 25, 2026 at 1:51 pm

    I would advise to launch your app directly using javaw. Since Scala compiles into the same byte code as Java – you can do it. Don’t forget to add standard scala libraries to the class path

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Swing runnable app which updates messages, then I have a Java
I am developing a swing app, where I have a Factory class which provide
I have a Swing app with a large panel which is wrapped in a
We have a standalone java swing app, in which the user can print something
I have a chat like desktop java swing app, where i keep getting String
We have a desktop application written in Java Swing that currently uses Java Web
I have a swing desktop app, with JPA and MySQL on the same machine.
I have a Java web application that has a 'disconnected' Java Swing desktop app.
I have a Swing application as jar file. I am launching the application in
I have a simple Swing app compiled with netbeans 7.1.2 on a ubuntu machine

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.