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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T20:56:44+00:00 2026-05-20T20:56:44+00:00

In Scala, packages doesn’t necessarily need to match folders. And if tooling wasn’t concerned

  • 0

In Scala, packages doesn’t necessarily need to match folders. And if tooling wasn’t concerned I would rather leave out the ever so redundant organisation prefix of the package to allow for shallower paths.

My problem is that the Eclipse JUnit plugin seems to be working with folders rather than classpath. When I place my Scala test classes in folders matching the package everything works fine. If I however put them the way I would like I get a ClassNotFoundException.

Say my package prefix is org.myorganisation.myproduct for all classes in a project. Then I would like to have folders like

src/test/scala/domainpackage1/

instead of

src/test/scala/org/myorganisation/myproduct/domainpackage1

but if I put a test class looking like:

package org.myorganisation.myproduct;
package domainpackage1
...
@RunWith(classOf[JUnitRunner])
class DomainClass1Spec extends FeatureSpec with GivenWhenThen {
...
}

in the folder

src/test/scala/domainpackage1

I get a

java.lang.ClassNotFoundException: domainpackage1.DomainClass1Spec

So it seems the JUnit plugin is looking at the source location and looks for a class file matching that rather than finding the class in a more stable way.

I mean, it should be possible to find the output (.class) from the current position in the compilation unit (.scala), right?

  • 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-20T20:56:45+00:00Added an answer on May 20, 2026 at 8:56 pm

    This is a known issue in Eclipse:

    https://bugs.eclipse.org/bugs/show_bug.cgi?id=16209

    It’s marked as WONTFIX. But perhaps you should comment on it and point out the issue for Scala…

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

Sidebar

Related Questions

We have a project that contains a library of Python and Scala packages, as
I've been experiencing confusion over packaging classes in Scala and importing packages. Let me
I am learning Scala from Martin Odersky's book Programming in Scala. In his Packages
I'm moving my first steps in Scala and I would like to make the
I need to check some system settings like ulimit -n from Scala script in
In Scala, I frequently have to import multiple packages worth of implicits and other
I have a GUI ive created in Scala. Its very simple but I would
I've just seen this case class in the Scala actors package: case class !
In Scala IDE I have the following code: package pkg.one object S { class
scala> import scala.collection.mutable.Buffer import scala.collection.mutable.Buffer scala> val b = Buffer(1, 2, 3) b: scala.collection.mutable.Buffer[Int]

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.