70: Cool NetBeans!
2011-02-09
Pop-Up: NetBeans IDE
- NetBeans IDE is "an award-winning Integrated Development Environment available for Windows, Mac, Linux, and Solaris."
- It is basically an awesome code editor for Java, PHP, Ajax, Ruby on Rails, C, C++, and a few others.
- As you are typing variables and functions it will attempt to auto-complete them with variables and functions built into the language you are writing in, as well as your own variables and functions you wrote from the project you are working on.
- A few of my favorite features:
- Browse your project by file or by class/methods
- Easily right-click on a function and choose Navigate > Go to Declaration
- Code Collapsing
- Code Refactoring to safely move, rename, or delete variables.
- The ability to have the file upload to your FTP server every time you click save!
- Free!
- Faster than other similar IDEs I've tried before (like Eclipse)
- Overall this is a nice development environment and is my IDE of choice for PHP projects.
- If you are interested in learning to write PHP, I highly recommend downloading NetBeans IDE as the autocomplete and bug checking features are really helpful!
Geek-Tweak: How to edit a live website with NetBeans IDE
- Since you downloaded NetBeans IDE after hearing how awesome it was a few seconds ago, let's learn how to use it to edit a live website!
- I'm going to walk you through how to edit an existing website and have it upload files each time you save them (since if you are interested in this you likely already have a website)
- you can also create a new project/website obviously, but that is more obvious on how to do it.
- First, use something like FileZilla (which we will review next week) to download your entire website into a directory on your computer. (works best if you don't have a podcast with tons of MP3s! you can just unselect those anyway if you do)
- Now open NetBeans IDE and choose "New Project" from the File Menu.
- Be sure PHP is chosen in the Category pane and "PHP Application with Existing Sources" is selected in the right pane.
- Click Next
- Click Browse to find the folder you just downloaded your website into.
- Give your Project a Name, then click Next.
- Now change Run As to "Remote Web Site (FTP,SFTP)
- Type in the URL of your website (with a slash at the end)
- Click "Browse" to make sure the project knows where your index (or default) file is for your website. (this helps the IDE know where public pages are and stuff like that)
- For Remote Connection click Manage, then "Add" on the Connection Management screen.
- Fill out all of the details (name, server, username, password, etc) for connecting to your web host. (you should have used these in your FTP client to download your website to your computer. If you don't know them, you probably don't have a website and this is a very boring podcast)
- If you are using SFTP, be sure to point "Known Hosts File" to a blank text file somewhere on your computer... this prevents you from having to OK the certificate each time you connect.
- click Test Connection to make sure you have everything right.
- If you are using SFTP it will (at least once) tell you it doesn't know the host, just click "Yes" if you are sure you typed everything in correctly.
- Once you pass your test, click OK to close the "Manage Remote Connections" dialog box.
- In the "Upload Files" drop-down, choose how you want to upload files... I like to upload them "On Save" so each time I save a file it uploads it.
- Uploading On Run means you can make tons of changes all over the place, then "run" the program and it will upload your modified files and launch a web browser pointing to your website.
- Click Finish
- you should now see your website's files listed in the "Project Window" on the left.
- It also normally opens your index file on the right so you can start editing!
- Now just edit a file and click Save, then go to your website and see if the changes are there!
- That's all there is to it, so from now on you just open NetBeans IDE and your website will be listed in the projects window and you can quickly start editing files and seeing the changes nearly instantly!
- To clarify one big detail: this is not a WYSIWYG website editor like Dreamweaver, it is an IDE that makes it easy to write large web applications and keep track of how your code works.
- With that said, happy editing!