Results 1 to 7 of 7
  1. #1
    chris97is is offline Member
    Join Date
    Sep 2009
    Posts
    4
    Rep Power
    0

    Default cannot resolve com.sun.java import - build path problem?

    I'm new to java programming, and I've heard that what I'm trying to do is supposed to be easy, but I'm stuck.

    I'm trying to move a bunch of code from a windows machine to a linux machine. Prior to moving it, everything worked and there were no errors. I'm moving the source code for a big, proprietary, undocumented mess called IVES that relies on jfreechart and a number of other libraries. I was told that all I need to do is change the build path, but I must have done something wrong, because I'm getting 2 errors I can't shake.

    Both errors say "the import com.sun.java cannot be resolved" and occur in the import statement section of two different classes.

    Java Code:
    import java.awt.*;
    import com.sun.java.swing.*;
    import ives.sim.*;
    is the code where the error occurs in one of the files.

    I zipped my entire workspace from the windows machine, switched machines and unzipped it, then the import button to get things into eclipse.

    I changed the build path through build path -> configure build path .

    Under the source tab, the only source folder is ives_test3/src. All the .java files are in subdirectories there, and the output goes to ives_test3/bin. Under the projects tab, it depends on jfreechart, which seems to be working ok, and under libraries, I've given it access to all the .jar files i had from the windows side.

    Any ideas on how to fix this? Am I missing some option on the build path?

    thanks

  2. #2
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    7

    Default

    You should not be using packages in com.sun.* We are not supposed to know about them.
    Are you sure it was like that in the Linux version?

  3. #3
    chris97is is offline Member
    Join Date
    Sep 2009
    Posts
    4
    Rep Power
    0

    Default

    Unfortunately, yes, it's definitely the same code as was on the windows machine. This library (I'm not quite sure if that is the right word) was originally developed in the mid 1990's for agent based modeling before there were better tools, and now I'm stuck with it.

  4. #4
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    7

    Default

    What jdk version was used on Linux and which version are you using on the Windows machine?

  5. #5
    chris97is is offline Member
    Join Date
    Sep 2009
    Posts
    4
    Rep Power
    0

    Default

    I don't have access to the windows machine anymore, but I was using the version of eclipse and java that I downloaded in about May.

    On the linux machine I'm using now, the Eclipse SDK is 3.2.2 I'm not sure how to find the jdk.

  6. #6
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    7

    Default

    I may have missed something here. Did you say that you got it working on one Windows machine and then moved it to another Windows machine where it's now not working?

  7. #7
    chris97is is offline Member
    Join Date
    Sep 2009
    Posts
    4
    Rep Power
    0

    Default

    I had it working on a windows machine, and I'm trying to move it to a linux machine and it's not working. The windows machine was running XP and is now a doorstop (thank goodness for weekly back-up policies), and I'm running Ubuntu on the new linux machine.

Similar Threads

  1. Import java.io.* problem
    By DD70 in forum New To Java
    Replies: 3
    Last Post: 07-28-2009, 10:45 PM
  2. Build Instances problem
    By leapinlizard in forum New To Java
    Replies: 4
    Last Post: 04-21-2009, 10:17 AM
  3. [SOLVED] SVN project's build path problem
    By er_zhong in forum Eclipse
    Replies: 0
    Last Post: 04-14-2009, 04:03 PM
  4. Replies: 3
    Last Post: 04-07-2008, 05:56 PM
  5. problem with PATH
    By creativehacker in forum New To Java
    Replies: 4
    Last Post: 07-11-2007, 02:54 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •