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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T13:36:39+00:00 2026-05-26T13:36:39+00:00

I have a multi-project Scala workspace in eclipse. I think I’m getting hosed by

  • 0

I have a multi-project Scala workspace in eclipse. I think I’m getting hosed by my lack of understanding of the way Scala imports packages, but after spending more time than I care to admit looking for a solution, I can’t figure this one out. I have recreated the problem in a simple 2 project setup.

Project 1: com.foo.mathematics contains a simple Vector class

Contains one file:

package com.foo.mathematics    

class Vector2D(x : Double, y : Double) {



  def length = math.sqrt(x*x + y*y)

}

Project 2: com.foo.analysis

package com.foo.analysis

import com.foo.mathematics.Vector2D



class Frame(xAxis : Vector2D, yAxis : Vector2D) {



}

Eclipse shows an error in the import line, The error message that I get is: Object mathematics is not a member of the package com.foo.

In the outline view, my import statement says this:

com.foo.analysis.<error: <none>>.Vector2D

I have tried changing the import to:

import mathematics.Vector2D

import _root_.com.foo.mathematics.Vector2D

neither one works…

What am I missing?

  • 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-26T13:36:40+00:00Added an answer on May 26, 2026 at 1:36 pm

    Both import com.foo.mathmatics.Vector2D and import _root_.com.foo.mathmatics.Vector2D should be fine. Most likely you either haven’t added the first project to the build path of the second (see Build Path > Configure Build Path in the context menu), or need to clean the second project (Project > Build Clean) after making changes in the first project.

    (Also, mathmatics looks like a typo for mathematics, so double check that you really have the same name in both places.)

    Relative package imports don’t come into it, they just mean you could write it this way:

    package com.foo
    package analysis
    import mathmatics.Vector2D
    
    class Frame(xAxis : Vector2D, yAxis : Vector2D) {
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I use eclipse and the maven plugin. I have a big multi-module project (~6
I have a multi-project ASP.NET + C# solution. I was planning on writing a
I have some multi-module project. Some modules are packaged as wars and some as
I have a multi-module project. I thought I can compile only a single module
I have a multi-module maven project with an installer sub-project. The installer will be
We have a multi-module maven project that uses a profile that defines a buildnumber-maven-plugin
I have a multi module web project. Four modules of the project are packaged
We have several independent builds (each independent build is a multi-project build). The main
I have created a multi module maven project. Now I have shared the project
I have a project using ASIHTTP to multi download files from a site when

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.