Results 1 to 6 of 6

Thread: Eclipse Setup

  1. #1
    smartino is offline Member
    Join Date
    Sep 2011
    Posts
    64
    Rep Power
    0

    Default Eclipse Setup

    To the forum,

    I am using Eclipse (Version: Indigo Service Release 1), and I have existing .java code and associated .class files in a directory /cscie160/hw4 which maps to my package statement in each of the .java programs. My problem is when I try to create a project in Eclipse, and just to run the programs it says it cannot find "main" and tells me errors exist in my programs, which run just fine from a command line...Typically the errors are referencing the package statement.

    Can someone assist with getting an existing set of code with existing package statements into Eclipse so that they will run correctly?

    thanks

    Steve

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

  3. #3
    jammas615 is offline Senior Member
    Join Date
    Jul 2011
    Location
    Melbourne, Victoria, Australia
    Posts
    155
    Rep Power
    4

    Default Re: Eclipse Setup

    Is your source in a named package of your projects' source folder?

  4. #4
    javajosh is offline Member
    Join Date
    Oct 2011
    Posts
    8
    Rep Power
    0

    Default Re: Eclipse Setup

    jammas615-- can you elaborate on that ? I seem to be having the same trouble -- what is a "named package" ? and what is the "source folder" ? Thanks so much!!!!!!!
    --Josh

  5. #5
    jammas615 is offline Senior Member
    Join Date
    Jul 2011
    Location
    Melbourne, Victoria, Australia
    Posts
    155
    Rep Power
    4

    Default Re: Eclipse Setup

    I you have a look at your package explorer on the left hand side, You should see all you projects in your current workspace.
    Your projects will have pluses next to them and you can expand you projects folders.
    When you first click, you will likely see some folders called: 'src' and 'JRE Sytem Library'... blah blah.

    'src' is your source folder and if you click on the plus you will expand it.
    Once expanded, you can see you packages and source files. (Packages have a symbol that looks like a brown box)
    If you dont have one, or there is '(default package)', create a new package and just drag your source files into it.

    It Looks like this:
    Java Code:
    +Project name
        +src
                +(default package) ----------You dont want this!!!
                +package for your source
                        - Class.java
                        - Class1.java
                        etc...
        +JRE System library[version]
    Hope that helps.

  6. #6
    javajosh is offline Member
    Join Date
    Oct 2011
    Posts
    8
    Rep Power
    0

    Default Re: Eclipse Setup

    Thank you so much !!! That was a big help !
    --Josh

Similar Threads

  1. java environment setup with eclipse
    By sueperg in forum Java Servlet
    Replies: 4
    Last Post: 09-14-2011, 07:41 PM
  2. Not able to see apache2 server in Eclipse WTP Setup
    By anupindi007 in forum Eclipse
    Replies: 1
    Last Post: 05-28-2011, 04:57 PM
  3. setup oc4j server in eclipse 3.3
    By mamri in forum Eclipse
    Replies: 0
    Last Post: 12-22-2008, 11:33 PM
  4. Eclipse Environment setup
    By mudgil.gaurav in forum Eclipse
    Replies: 1
    Last Post: 09-18-2008, 07:10 AM
  5. Setup
    By Mir in forum New To Java
    Replies: 9
    Last Post: 06-27-2008, 11:12 AM

Posting Permissions

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