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 6860317
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T02:23:37+00:00 2026-05-27T02:23:37+00:00

I’ve just been experimenting with Jenkins and setting up a few projects. One inparticular

  • 0

I’ve just been experimenting with Jenkins and setting up a few projects. One inparticular calls a shell script and the exit code from that script is picked up correctly, producing a pass/fail. Yet when I call Scala from the command line, it passes no matter what happens.

In the Execute shell box:

/opt/scala/2.9.1/bin/scala sdfsdfsd
Exception in thread "main" java.lang.RuntimeException: 
Cannot figure out how to run target: sdfsdfsd
... (stack trace removed)
Finished: SUCCESS

Yet doing the equivalent with Java produces a failure:

/opt/java/jdk1.7.0/bin/java sdfdfsd
Error: Could not find or load main class sdfdfsd
Finished: FAILURE

Both of these produce an exit code of 1 when running from bash (with echo $?)

Am I missing something or is this a bug?

EDIT:

Interestingly, I am seeing the same behaviour when using ant exec – when I call a shell script containing an invalid call to scala I get the expected error code, but via ant (with failonerror=’true’) I see zero and build successful.

Thanks

  • 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-27T02:23:38+00:00Added an answer on May 27, 2026 at 2:23 am

    This is a known bug Scala eats exit code when piping stdin, fixed in trunk.

    To patch your system, the fix is quite easy, in the $SCALA_HOME/bin/scala script, line 25ish

    function onExit() {
      if [[ "$saved_stty" != "" ]]; then
        restoreSttySettings
        exit $scala_exit_status
      fi
    }
    

    Move the exit to outside the if:

    function onExit() {
      if [[ "$saved_stty" != "" ]]; then
        restoreSttySettings
      fi
      exit $scala_exit_status
    }
    

    This will fix your problem (in ant as well actually, but you will have to do the same thing for scalac).

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

Sidebar

Related Questions

I have just tried to save a simple *.rtf file with some websites and
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I have this code to decode numeric html entities to the UTF8 equivalent character.
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I'm making a simple page using Google Maps API 3. My first. One marker
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti

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.