How to add a folder into eclipse for development work? - eclipse

I have cloned a git repository (which contains lot of python, shell, json files) using git clone command from git bash and it is in my workspace location. I would like to add the whole repository folder into eclipse and want to do modifications / edits to the shell, python files there. How can I do it?
Note: I am Pretty new using Eclipse and I would appreciate your help.

There is no need to create a Java project and let unnecessary Java dependencies and libraries to cling into the project. The question is regarding importing an existing directory into eclipse
Suppose the directory is present in C:/harley/mydir
What we have to do is ,
Create a new project [Right click on Project explorer, select New -> Project, From the Wizard list, select General -> Project .. click next ]
Give the project name same as your target directory , Here 'mydir'.
Uncheck the 'Use default location' and give the exact location , ie: C:/harley/mydir and click on Finish.

Related

Can't run project in Eclipse imported from Git

I have a project in my Eclipse workspace from Github (via File -> Import -> Projects from GIT).
However, I am unable to run the example because the only option I have under "Run As" is "Run Configurations."
After going to "Run Configurations" I click "browse" and the project that I imported from GIT isn't there.
Any ideas?
The question is already answered in the comments but I am providing this answer to possibly clear up some misunderstandings.
In order to recognize a folder as a (Java) project, Eclipse needs to read (or create) a few files for each project, like .project and .classpath. If you do not have them in your project, or do no create them during the import, then Eclipse just imports it as a resource, or a dumb folder.
If your project is tracked by git and is also a maven project, you can clone it locally with Git (command line or GUI tool) and then "Import as existing Maven project" in Eclipse. This will use your pom.xml to create the two files mentioned above and your project will be buildable.
Alternatively, if you have already imported it as you described in your question, you can right click on your project on Package Explorer and choose Configure-->Convert to Maven Project. This will create the .project and allow you to build the project using Maven (right click->Run as..-> Maven build) and Eclipse's incremental builder (where necessary). If your maven project builds an executable, the option to execute it will also be available in the Run as.. menu.
If you have a more complex maven project (like an aggregate pom), and want a Run Configuration that runs a specific program, you will have to write it yourself by opening the Run Configurations window and explicitly referencing the java class.
Don't import the project using git clone. Download it as zip file and extract it. Add it using Project>import> General> Projects from folder and Archive.
Provide path of extracted folder into import source and finish and go to eclipse and clean and build safely run and right click on project and run it.
It should work

how to import nodejs projects into nodejs eclipse in mac

I have cloned a project and try to load into nodejseclipse(mac) as file system or existing project. but it does load only root folder js files. it does not load all folder structures into eclipse. can you please help me on this.
You need install nodeclipse, first.
npm install -g nodeclipse to install it
Go to your folder, nodeclipse -g to generate nodeclipse project setting.
Open it from Eclipse "import from other projects".
It is not quite intuitive, but the following worked for me.
Move the project into the workspace directory. Then:
File > New > Project ...
Under Nodeclipse select Node.js Project and next >.
Under Project name: type the same name as the project you are importing and press Finish.
Now you should have the project visible in the Package Explorer.
To make .* files visible press the small arrow in the Package Explorer (top right) > Filters ....
Deselect .* resources > OK.
File -> New Project -> Node.js Project -> Project Name (Give some relevant name)
Next click on "Use default location" checkbox to check it off.
Next browse to the location where project has been cloned/exists
Finish.
Created a project folder in eclipse. Dragged the source and drop into project folder in eclipse. and then linked the source folder

Eclipse and SVN import a existing folder that has been SVN checked out

I have a folder (it also has subfolders, containing many java files) on my local hard disk.
This folder was checked out from my svn repository. I can do all the svn commands in that folder.
Now i am using Eclipse, is there a way for me to "import" that folder, and so that for all the changes I made in the Eclipse editor on those files will be reflected as well?
My question is same as How to import an already checked out svn repository into Eclipse?
BUT, the answer, I am not able to get, such as "import..." then "share...", can someone please elaborate these two steps?
If i do "import..." -> "General" -> "existing project"
BUT i don't get it, the folder i want to import is NOT an ECLIPSE PROJECT, so should i still go with this route?
or should I do "Import..." -> "General"-> "file system"? but it requires me to create a project first in eclipse, so i don't think i should go that path
here is what i awant to archive at the end
1. For the folder i want to import, i want to be able to do all the svn stuff, such as commit, update,etc
2. the file i edit in the eclipse, should be the same file in the folder i checked out from svn
please help....
"import..." -> "General" -> "existing project" (Browse for the project which u have checked out into ur local hard disk)
then in that window down there is a checkbox to select "copy projects into workspace" => uncheck this option.
this will have project in Eclipse and local existing folder that has been SVN checked out where u can
1. For the folder u want to import, u want to be able to do all the svn stuff, such as commit, update,etc
2. the file u edit in the eclipse, should be the same file in the folder u checked out from svn.
cheers.. this will work!!
For anyone that has tried all of the suggestions dealing with importing projects and find that it still doesn't work, you may have a mis-configured connector.
Go to Window -> Preferences -> Team -> SVN -> SVN Connector. Make sure the version of the SVN Connector matches the version of SVN you have checked out the code with.
For example, if your connector is configured for svn 1.7.x, and the source is checked out with 1.8.x, then Eclipse will not recognize your SVN repository. If you don't have the right SVN Connector version installed and can't convince Eclipse to install it automatically, you might want to go to the SVNKit web site for further instructions.
Once you have the proper SVN Connector specified, go back and try to Share Project (or Share Projects), or remove and re-import the existing projects.
I was able to "import" a folder without .project-file:
File -> new -> Project... -> General -> Project
Then you have to chose the Location (untick "Use default location" and press the "Browse..." Button):
Press "Finish" and you get the Project in eclipse with SVN History. Also eclipse adds the ".project" file.

How to convert IntelliJ project to Eclipse?

I have one IntelliJ project and I want to open it in Eclipse, so what should I do?
There is an export to eclipse option in Intellij Under file menu.
This option will generate you the necessary .project and .classpath files that will be used by eclipse. Personally, I would remove any IDE dependencies using some dependency management systems like Maven or Apache IVY. ( Is system the right term?)
I had the same issue and (I don't have Intellij) but doc_180's comment pointed me in the right direction. Here is a simple solution. In Eclipse create a new blank Android project. Copy the .project and .classpath files and the .settings folder to the Intellij folder. Edit the .project file and change the name of the project.
You should now be able to Import the project in Eclipse by right clicking and selecting "Import->Existing Project into Workspace".
I see this is an old question, but thought I should add this answer for others Googling it like me ;)
Without access to IntelliJ to export and convert the project, try the following.
In STS or Eclipse create an empty project first, then, select File -> Import and choose General -> File System. In the resulting dialog box, select the root folder of the IntelliJ project as source and the empty project as the destination.
For unit tests, add the test folder as a source folder to the build path (right-click on the folder, select Build Path -> Use as Source Folder).
The projects I import this way run without any further modifications, including the tests.
Eclipse and Intellij create different project structure each other (Output path, Source Code etc...). You can export the current project to Eclipse environment.
File -> Export -> Project to Eclipse

How to make an existing directory into an eclipse project

I have a project I am working on. I have decided to try working with it in Eclipse. There is already a directory, under version control where all the code resides. I am having a rather strange problem. I cannot find any way to just start using an existing code directory as an eclipse project. All I can find is how to import existing source into a new project or check out source from version control into a new project. How do I make an existing directory into a project?
My project is a Django web app if it is any help
In the New Java Project wizard, uncheck the checkbox that says Use default location and the use the Browse button to find your directory.
It is pretty easy to do. Go to File->New-> Project. In the Project wizard, choose the type of project you want and then be sure to unclick the 'Use default location` checkbox. Browse for your folder in the widget that then becomes enabled. Click finish after that.
Alternatively, you could create a brand new project workspace in a new location. Then, assuming Java as your project type, you can open up your project properties and add as a source folder your existing directory. To do this, use the 'Link Source' button on the Java Build Path -> Source tab of your Project Properties dialog.
My Method:
I clone this file to new project directory , and rename Project-Name to my project name, after that i import new files and directory from Eclips
File Name: .project ( Use Notepad for make this file...select Save as type to All Files (*.*) and write file name like: .project )
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>Project-Name</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
</buildSpec>
<natures>
</natures>
</projectDescription>
Hope this link answers the original question of this thread.
http://help.eclipse.org/juno/index.jsp?topic=%2Forg.eclipse.platform.doc.user%2Ftasks%2Ftasks-45.htm
Creating linked resources
Folders and files can be linked to locations in the file system outside of the project's location. These special folders and files are called linked resources.
To create a linked folder:
In one of the navigation views, right-click the project or folder where you want to create the linked folder.
From the pop-up menu, select command link New > Folder.
Specify the name of the folder as it will appear in the workbench. This name can be different from the name of the folder in the file system.
Click Advanced.
Check Link to alternate location (Linked Folder).
Enter a file system path, or click Browse to select a folder in the file system.
Click Finish.
Probably not the way most people would go about this, but I like all of my eclipse projects in one place but don't necessarily have my source in my workspace directory. Maybe there is a built in way to "symlink" in eclipse, but I sometimes end up with the project folder in the workspace, with the "src" symlinked to the actual source directory somewhere totally different. That's my personal preference anyway. If you too are on a *nix machine a simple
ln -s /path/to/source src
will do from your project directory.
You know, it is not so simple question. Depending on your project type (jar, web module, ear and so on) different structure and configuration files are used by eclipse. So the first really interesting question is that what is your project type? The basic solution after it to create a new project, and define the directory of your source code as project root. Then you will see what else to change (for example source path settings, classpath and so on). So how does your project look like? Can you proide structure tree of folders?
Since you are using Django you should first set up PyDev in Eclipse. You can install it from the market. Then you want to configure the PyDev Python interpreters to find your installation of Django (http://pydev.org/manual_101_interpreter.html). Make sure to provide the explicit path to the Django folder if your Django is not installed in the default location.
Once these things are ready you can select File > New > Other, then select PyDev Django Project from the PyDev sub directory.
Click next and here is the sweet part: Uncheck 'Use default' (as previously stated) and then find your Django project directory. Be sure to select the right project folder (ie: the folder that contains manage.py). When you have the right folder selected Eclipse/PyDev will recognize that a project already exists and make mention that it will use those files. Click Finish.
Then there is a DB form that asks about your DB settings. If you already have a settings.py file then this seems to make no changes (as it should not). So fill it in or don't. But this is the last step.
Then you should be able to view and use your existing project in Eclipse!
I just created a pom.xml by hand and imported the project as an existing Maven project in Eclipse. It even works for nested projects without problems.
Use "import - existing projects into workspace". This works for my case.
Right click on a project -> Properties.
Open project location in explorer, there's a little icon next to path.
Put your folder/file structure in there and refresh the project in eclipse.