Home » Newcomers » Newcomers » Super simple: Importing into eclipse on a mac(How to import into eclipse using a mac)
Super simple: Importing into eclipse on a mac [message #698597] |
Tue, 19 July 2011 15:04  |
Eclipse User |
|
|
|
Hey guys.
I'm completely new to Java (taking Stanford's CS106A programming methodology online), using Eclipse on a Mac to run some pre-made karel programs, and I'm having a problem importing the assignments into Eclipse. It would be great if anybody could lend a hand.
Here's what I do to import my assignment:
I click on File>Import>Existing Projects into Workspace. Then I browse to the Assignment1 folder (under Select root directory), but when I select the Assignment1 folder, no projects appear (even though there are lots of files in the Assignment1 folder), and it doesn't let me import anything at all.
So I'm not able to import any of the assignments, worlds, or background necessary to do the assignment. Any suggestions?
Thanks in advance!
|
|
|
Re: Super simple: Importing into eclipse on a mac [message #698636 is a reply to message #698597] |
Tue, 19 July 2011 16:39   |
Eclipse User |
|
|
|
On 19-Jul-11 13:04, forums-noreply@eclipse.org wrote:
> Hey guys.
> I'm completely new to Java (taking Stanford's CS106A programmingmethodology online), using Eclipse on a Mac to run some pre-made karel programs, and I'm having a problem importing the assignments into Eclipse. It would be great if anybody could lend a hand.
>
> Here's what I do to import my assignment:
> I click on File>Import>Existing Projects into Workspace. Then I browse to the Assignment1 folder (under Select root directory), but when I select the Assignment1 folder, no projects appear (even though there are lots of files in the Assignment1 folder), and it doesn't let me import anything at all.
>
> So I'm not able to import any of the assignments, worlds, or background necessary to do the assignment. Any suggestions?
>
> Thanks in advance!
Those projects you think you have under Assignment 1 aren't Eclipse
projects. For this reason, you'll need to create a new project (Java
Project, Dynamic Web Project, etc.), then on the wizard's first page,
designate Assignment 1/project as the source for the project. Eclipse
will then create .project, .classpath, etc. in that project and it will
become an Eclipse project.
Hope this helps.
|
|
| |
Re: Super simple: Importing into eclipse on a mac [message #698661 is a reply to message #698645] |
Tue, 19 July 2011 18:20   |
Eclipse User |
|
|
|
On 19-Jul-11 15:32, forums-noreply@eclipse.org wrote:
> Thanks for the reply!
>
> I tried to create a new project, but it wouldn't let me for some reason (the "finish" tab is grayed out).
> I took some screen shots of the steps that I took to start a new project--File>New>Project then General>Project>Next, then gave it a name (Assignment1), but it's not letting me finish.
> Also here are the example files that live in the Assignment1 folder that I'm trying to put into Eclipse (they are .java, .jar., and .w)
>
> Thanks again.
> -e
Choose a Java Project rather than a generic Project.
This said, under Assignment 1, you don't have any kind of Java project,
but just Java sources and a JAR. This wouldn't be legitimate even for
command-line javac.
In order to make an Eclipse Java Project, create a new Java Project,
with the name you want (maybe Assignment-1?), then create a package (or
packages) under the src subdirectory that corresponds to the package
directive inside your Java file(s). Right-click on a package, choose
New..., then Class and give it the name of one of your Java files. Copy
the contents of that file into the new one. (There are more
sophisticated ways to achieve this, but they're usually frustrating.)
Add a lib subdirectory to the root of your project and copy the JAR file
to it. Right-click on the project and choose Build Path -> Configure
Build Path -> Libraries -> Add JARs to add that JAR to your project
(you'll navigate to find it under that lib subdirectory you created).
Basically, I've told you here how to create a project from scratch
because your "project" on disk aren't really projects at all.
|
|
|
Re: Super simple: Importing into eclipse on a mac [message #777701 is a reply to message #698661] |
Tue, 10 January 2012 17:46   |
Eclipse User |
|
|
|
Hi Russell,
I'm trying to do the same thing as erkmania, but am running into a few problems. I have all the same files and the latest eclipse downloaded. Here's my problem(s):
1. When you say to create a package (or packages) under the src subdirectory that corresponds to the package directive inside your Java file(s). What exactly does this part mean? In the list here, which are my package directives?
I've clicked on my src subdirectory to create a new package, but I'm not sure if the package directive is the .class or .java files I've got contained. This is where I'm most confused.
2. When I go to >build path > configure build path > add JARS > my karel.jar isn't listed. I have to have to add my jar via > Add External JARS. Is there is a difference between the two? Will it matter?
Thanks much for your help and patience!
BM
Choose a Java Project rather than a generic Project.
"This said, under Assignment 1, you don't have any kind of Java project,
but just Java sources and a JAR. This wouldn't be legitimate even for
command-line javac.
In order to make an Eclipse Java Project, create a new Java Project,
with the name you want (maybe Assignment-1?), then create a package (or
packages) under the src subdirectory that corresponds to the package
directive inside your Java file(s). Right-click on a package, choose
New..., then Class and give it the name of one of your Java files. Copy
the contents of that file into the new one. (There are more
sophisticated ways to achieve this, but they're usually frustrating.)
Add a lib subdirectory to the root of your project and copy the JAR file
to it. Right-click on the project and choose Build Path -> Configure
Build Path -> Libraries -> Add JARs to add that JAR to your project
(you'll navigate to find it under that lib subdirectory you created).
Basically, I've told you here how to create a project from scratch
because your "project" on disk aren't really projects at all."
|
|
|
Re: Super simple: Importing into eclipse on a mac [message #777702 is a reply to message #698661] |
Tue, 10 January 2012 17:47   |
Eclipse User |
|
|
|
Hi Russell,
I'm trying to do the same thing as erkmania, but am running into a few problems. I have all the same files and the latest eclipse downloaded. Here's my problem(s):
1. When you say to create a package (or packages) under the src subdirectory that corresponds to the package directive inside your Java file(s). What exactly does this part mean? In the list here, which are my package directives?
I've clicked on my src subdirectory to create a new package, but I'm not sure if the package directive is the .class or .java files I've got contained. This is where I'm most confused.
2. When I go to >build path > configure build path > add JARS > my karel.jar isn't listed. I have to have to add my jar via > Add External JARS. Is there is a difference between the two? Will it matter?
Thanks much for your help and patience!
BM
Choose a Java Project rather than a generic Project.
"This said, under Assignment 1, you don't have any kind of Java project,
but just Java sources and a JAR. This wouldn't be legitimate even for
command-line javac.
In order to make an Eclipse Java Project, create a new Java Project,
with the name you want (maybe Assignment-1?), then create a package (or
packages) under the src subdirectory that corresponds to the package
directive inside your Java file(s). Right-click on a package, choose
New..., then Class and give it the name of one of your Java files. Copy
the contents of that file into the new one. (There are more
sophisticated ways to achieve this, but they're usually frustrating.)
Add a lib subdirectory to the root of your project and copy the JAR file
to it. Right-click on the project and choose Build Path -> Configure
Build Path -> Libraries -> Add JARs to add that JAR to your project
(you'll navigate to find it under that lib subdirectory you created).
Basically, I've told you here how to create a project from scratch
because your "project" on disk aren't really projects at all."
|
|
| |
Re: Super simple: Importing into eclipse on a mac [message #786825 is a reply to message #777729] |
Mon, 30 January 2012 16:14  |
Eclipse User |
|
|
|
Did you get this to work?
I have tried a lot now (total newbie just started the CS106A stanford online course) and I think I got something working:
I did like this:
1. download "assignment 1" from the Stanford site.
2. As the zip file is automatically unzipped in the download folder (on mac OS Lion), I moved the folder to the desktop, right clicked the folder, selected "compress assignment 1", then I had the zip file again.
3. In Eclipse (I use Indigo Service Release 1 - couldn't get the Stanford version to run on Lion) choose File --> Import --> General --> Existing Project into workspace --> select archive file --> browse --> assignment 1.zip (the one you compressed above) --> open.
After this I can write code and get it to work but only CollectNewspaperKarel.java! This I don't understand as assignment 1 has 4 smaller tasks, but no matter which of the 4 I write in and choose it runs CollectNewspaperKarel.java. Frustrating but for now I just write the code for each sub assignment in the collectnewspaperkarel and try it that way.
Any ideas of what I do wrong in this last part?
|
|
|
Goto Forum:
Current Time: Wed Jul 23 08:20:55 EDT 2025
Powered by FUDForum. Page generated in 0.30731 seconds
|