0

I want to try netbeans for web development. I created a new local project. I have my remote server files (javascript, php etc) accessible locally on my computer using sftp in linux, now I just want to add these files to the project but there is no 'add files' possibility. Have Oracle forgotten something so obvious as add existing files? I can't believe it.

1 Answer 1

1

To add an external file to your NetBeans project:

  • Select the file in the file system that you want to add to your NetBeans project using a file manager (such as File Explorer on Windows).
  • Right-click and select Copy from the popup menu.
  • Within NetBeans go to your project and position the mouse over the target directory to which you want to copy the file. You can do this in the Projects panel or the Files panel as appropriate.
  • Right-click and select Paste.

That's all there is to it. This works on Linux and Windows. You can also do drag and drop, though on Linux the file is copied whereas on Windows the file is moved.

There is no menu option in NetBeans such as File -> Import existing file to do this. Just use an external file manager.


Update/clarification:

  • The instructions above only specify how to copy an existing file into an existing project.
  • There is no way to include an individual file that is external to the structure of a NetBeans project.
  • However, it is possible to create a symbolic link (junction) from a NetBeans project directory to an external directory. To do that open a Command Prompt window as an administrator and enter a command similar to this:

mklink /J D:\NetBeansProjects\HTML5DemoCss\nbProject\MyLink2 C:\sftp

That will create a new directory in your NetBeans project named MyLink2 which maps to an external directory named c:\sftp. You can then process files in that external directory C:\sftp as though they were within your project directory MyLink.

symLink

Sign up to request clarification or add additional context in comments.

6 Comments

Won't it then be copied to a new folder and then a copy of the server file will be modified? I need Netbeans to use the file in my local sftp mapped folder so its modified on the server.
@ejectamenta OK, I misunderstood what you wanted to do. I have updated my post. Does that help?
Ok, I'll give it a shot later
'ln -s' doesn't work, ntbeans doesnt read the file, 'mount --bind stp:/etc folder' also not "mount: special device sftp:/etc does not exist", 'ln stfp:/etc folder' gives fails to find the sftp directory.
Ugh! I verified that this approach worked on Windows, not Linux. I'll try Linux over the weekend.
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.