How to open Non-Netbeans project in Netbeans? - netbeans

When we create a (PHP) project in Netbeans 7, it somehow saves the directory in its own format, and later we can open the project in Netbeans. However, I have a project which I created without Netbeans, now I want to open it with Netbeans, but seems that I can not. When I "Open Project" in Netbeans, and browse to the directory, it does not not recognize the directory. So how can I open a Non-Netbeans project in it?
Thanks.

In NetBeans IDE 8.0.1
File->New Project
Select PHP-> PHP Existing Sources, Click Next
Browse Source Folder and Select it
Give project a name
If you want you can keep a backup in a separate directory, Click Next
And select your Server
Click Finish

Select "File" > "New Project"
Under "Categories" select "Java"
Under "Projects" select "Java Project with Existing Sources"
You'll then need to tell it which directory contains your sources and which directory contains your JUnit tests.

Go to the window menu and select favorites. Then a tab include beside projects, files...then drag a folder from file explorer and put it into favorites.

You can either use the "Import Project" from the File menu, which can transform an Eclipse project to a Netbeans one for example (there might be other transformations available as plugins, don't know), or just create a new Netbeans project with your existing code.

Go to File Then New Project
Under "Categories" Select PHP.
Under "Projects" Select PHP Application with Existing Sources, Click Next.
Browse Source Folder and Select it.
Give project a name.
If you want you can choose PHP Version, Click Next
And select your Server
Enter project url or link. (i.e http://localhost/onlinevoting).
Choose index file This file is mostly index.php file or the default file for your website.
Click Finish.
reference : https://mauricemutetingundi.blogspot.com/2019/01/how-to-open-existing-php-project-in.html

Just copy this template nbproject folder from the archive nbproject.7z to your target folder. After it, you can open folder as NB project. It is just minified NetBeans 8 project definition.
Base64 7z data uri copy

Related

Import and run applications in Eclipse from folders

I'm trying to open files and run applications from folders that are not in the Package Explorer tab. I'm trying by using the File/Import/General/File System... I then select the folder, but the Finish button is still disabled!?
Is this not the correct way or is there a better way to open projects from other placeses than Package Explorer Tab?
Go to File>import>General - Select Existing project into workspace
Select project folder, uncheck copy project into workspace click finish. Note: Project must be a valid project.
You can only import a folder which contains Eclipse project specific files like .project etc. This way Eclipse knows it is a project.

How to import an existing directory into Eclipse?

I am on a mac, but I don't think it will make a difference. I have a directory that I want to fully import/add into Eclipse. What I did is this:
Right click import
General → Existing Projects into Workspace
Then when I click browse for either root directory or archive file and select the folder I can't click finish. The folder is empty and just contains a few folders but for some reason I can't click finish.
The Eclipse UI is a little bit confusing.
The Import -> "Existing projects into workspace" actually means import "Existing Eclipse projects into workspace". That's why you can't click on finish: the import option looks for a .project file (the file used by Eclipse to store the project options) in the directory that you have chosen.
To import existing source code that doesn't have an Eclipse project file you have the following options (I suppose that you want to create a Java project):
New project inside the workspace dir: Create a new empty Java project into the workspace (File->New->Java Project). Then right click on the source folder and choose Import...->General->File system then choose your files, and it will make a copy of your files.
Tip: you can drag&drop your files from the Finder into the src folder.
Create an eclipse project in your existing dir: Create a new Java project, but in the "New Java Project" window:
Un check the Use default location option, and choose the directory where is your non-Eclipse project.
Click Next and configure the sub-directories of your non-Eclipse project where the source files are located. And you are done :)
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 you have to do is the following:
Create a new project (Right click on Project explorer, select New -> Project; from the wizard list, select General -> Project and click next.)
Give to the project the same name of your target directory (in this case mydir)
Uncheck Use default location and give the exact location, for example C:/harley/mydir
Click on Finish
You are done. I do it this way.
These days, there's a better solution for importing an existing PHP project. The PDT plugin now has an option on the New PHP Project dialog just for this. So:
From File->New->PHP Project:
I Using below simple way to create a project
1- First in a directory that desire to make it project, create a .project file
with below contents:
<projectDescription>
<name>Project-Name</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
</buildSpec>
<natures>
</natures>
</projectDescription>
2- Now instead of "Project-Name", write your project name, maybe current directory name
3- Now save this file to directory that desire to make that directory as project with name ".project" ( for save like this, use Notepad )
4- Now go to Eclips and open project and add your files to it.
For Spring Tool Suite I do:
File -> Open projects from File System
The thing that works best for me when that happens is :
Create a new eclipse project(JAVA)
Take your source file (contents of the src folder!!!) and drag from finder and drop into the src folder in eclipse IDE
Make sure you add your external jars and stuff and tada you're done!!

How to open project from workspace in Eclipse?

I imported an Eclipse project into workspace and after some time I deleted it in Eclipse (from project explorer but not from workspace). Now, I want to reopen it, or import it again, but I cannot import it because such a project already exists in the workspace and when I try to open it, in tab Project -> Open Project, it is disabled. Of course, I can delete the project from workspace and import it again, but this is not what I want. So the question is: how can I open the project, which is in Eclipse's workspace, but has been deleted from the Eclipse's project explorer?
This is exactly what I just ran into. The 'Finish' button is greyed out, as is the check box and project name in the project window. If you try to check that check box the project will not be greyed now, but it won't check. Refresh does nothing.
The trick (or is it a bug) is to uncheck 'copy projects into workspace' hit the refresh button and it will now be checked and you can hit the finish button. Project will now once again be available in the Package Explorer.
(I'm using Eclipse 3.8 and ADT 21.0.1)
These Steps You Have to Follow
Click File menu
In file menu click Import
A window is open Now click General Folder
Now click Existing project into workspace
Then click the select from root directory
Now import project which you want......
You have to choose the project in the workspace, not the zip file with your project. Your project is still in your workspace, and because Eclipse wants to copy the project from the zip file you chose (look at the checked check box "Copy projects into workspace"), you get that warning.
Just select "Select root directory" and choose your workspace as your root directory and choose the project you want to reimport (and make sure, that the checkbox "Copy projects into workspace" is not checked).
Go to “%ECLIPSE_HOME%\configuration.settings” and delete the workspace listed at the key RECENT_WORKSPACES
Restart Eclipse, go to File>Switch Workspace>Other… and select your workspace dir again
Now I could create new projects as always
One simple trick is to delete the project from your work-space directory manually and than try to import project again. That's it...
I've experienced this same problem. It was a deleted workspace which I re-imported. When I tried to work with junit tests in the directory, it said that parts of if were not in the "project" In order to fix this, I had to check the "SEARCH FOR NESTED PROJECTS" and that corrected the issue.
I know that this is a really old question, possibly the solution was not available back then, but on my system (Eclipse Photon 4.8.0) it works like this:
File menu
Open Projects from File System...
Here you can give Eclipse a path to a directory (in this case your own, currently used workspace directory) where it will search for possible projects, list them and let you choose which one to import into the workspace. It will show already imported (aka. existing inside Eclipse) projects grayed out and unselectable, but has an option to hide these as well.
After selecting the project you'd like to import just click the Finish button and voila.
Make sure that your project is included in current workspace, then you have to see the project under "Project Explorer".
Note: you can view this from: Window->Show View->Project Explorer.
If you are facing this:
Some projects cannot be imported because they already exist in the workspace --> "Finish" button is grayed --> hence, no way to open the project(s)
Solution:
Go to File -> Open File...
Choose any one file of your project, and the entire project folder will open in your present workspace.

Is there an equivalent of "Add existing file" (to project) in Eclipse?

I am trying to map my Visual Studio experience onto Eclipse. Right now, I wish to add a file existing somewhere on the file system into a project in Eclipse. I expect it to be copied to the project source folder.
Currently, I see only one way - switch to the windows explorer (total commander, in my case) and copy the file myself, after which to refresh the project.
Can I do the same without leaving the Eclipse IDE?
Thanks.
I had the same problem, but found yet another solution.
Let me state my problem so that we're sure we're talking about the same thing.
I had a file in a directory where a bunch of code files were and some of the files in that directory were shown as "in my project" and some of the files were missing. I wanted the missing files to appear in my project.
I simply selected the folder in my project and pressed 'F5' or right-clicked and selected 'refresh' and the files appeared in my project. It looks like that is the intended way of doing this.
File->Import->General->File System should do it.
There you can select the file(s) from some file system folder to your project (into folder).
Even easier. Just drag and drop the file from explorer into the correct package in Eclipse. It will ask you if you want to copy or link the file(s).
I am a newbie to Eclipse Luna (the 64 bit latest version on Windows 7) but this worked for me:
Copy the preexisting source files you which add to your project.
In Project Explorer, right click your project and select New > File
In the "New File" dialog box, your project's name / folder should be displayed as the parent folder for your new (existing) source file.
Click on the "Advanced" button at the bottom of the "New File" dialog box.
Check the "Link to file in the file system" checkbox.
Click the "Browse" and browse to your preexisting source.
Click the "Finish" button at the bottom of the dialog box.
In my case, I had to:
right-click the project's name
choose "Close Project"
right-click the (now closed) project's name again
choose "Open Project"
Refreshing didn't work for me. :(
Hopefully this helps someone else...
Just found the quickest way to add files:
Copy-paste your file into your project disk directory using your file browser.
In Eclipse project browser select your project.
Click [right mouse button]->Refresh (or press F5 on Windows machine).
Voila
(worked on Neon-4.6.2)
I just got this to work. YMMV
I don't suppose it has to be there, but I put my file, xyz.cpp, into my project's source directory. My project has a source subdir named src, as in ProjName/src.
Right Click on project name (my project was open and the only one open).
NEW->FILE. Put in the filename, xyz.cpp. Click OK or press enter.
The file will open in the editor and complain that it is empty. Close it WITHOUT SAVING.
Reopen the file. It now has its contents.
It turns out that just simply dragging the files into the src folder would work!
Right-click on the file after you have copied it into the project directory. Select Properties... in the left hand pane select C/C++ Build. There will be a checkbox "Exclude resource from build" uncheck that check box.

In Eclipse, how to copy an existing project to another project?

In Eclipse, I have one existing project, A. Right now, I have just created another project, B, which is empty. Is it possible to copy all the files of project A, including its source code and related libraries to project B? There are a lot of involved libraries in project A. How to do this copying process correctly to ensure the copied files can still be compiled?
This question appears in Google search as top result for query "copy project in eclipse".
To copy project in Eclipse:
1) right click on project in Package Explorer view;
2) choose Copy;
3) right click on free place in Package Explorer view;
4) choose Paste;
5) enter new name in the prompt window.
To answer actual question, the best way is to delete project B and after -- copy project A as explained above and give it name B.
Close Eclipse
Copy the folder of existing project to anywhere on your disk.
Start Eclipse. Turn off the automatically build.
In the Eclipse do Refactor / Rename to the new project name. (If it connected to CVS/SVN disconnect before rename.)
Import back the old project from place where you copied in the second step.
Turn on the automatically build.
Enjoy them!
You can Import the project
OR
Assuming both project A and B are of same type:
You can copy the contents of src folder as it is.
For the libraries, just go to the build path and add them in the ssame way you did for project A.
Since B is empty, you can just copy project A in the Package Explorer and name the copy B.
Create a duplicate/copy of an existing project (in the workspace).
Then in Eclipse, click file->import
Select import existing projects into workspace
Check the radio button "Select root directory"
Browse your project (the new file you copied in workspace in step 1)
Done!
In the project Explorer, right click your old project, click "Copy", right click again click on "Paste" this time, change the default given name "Copy of My_Old_Project" to any of your choice, after the copy is done, go to the "Search" tab in Eclipse, then to --> "Search", on the File Search, type the old name of your project, make sure that your scope is only "Enclosing project", change all occurrences into the new name, run the project, you are all set...
only thing I noticed about this is that the url will still be of the old project.
For a Gradle project, I had to add two extra steps to mOna's answer, which I will copy for completeness.
Create a duplicate/copy of an existing project (in the workspace).
Then in Eclipse, click file->import
Select import existing projects into workspace
Check the radio button "Select root directory"
Browse your project (the new file you copied in workspace in step 1)
Edit .project file and change the and the to match the new project.
Edit settings.gradle and change rootProject.name to match the new project.
I assume that the renaming in some of the above answers does step 6, but I couldn't get it to work. No matter what I tried, without those extra steps the code looked ok but dependencies were not handled correctly and errors appeared everywhere. I was even able to run gradle on my project from the command line and it "built", but was actually building the old project.
Eclipse has a option in file menu like import existing projec.From that you can import the existing project with all content.I hope this is the solution that you are looking for.