13.07.2015 Views

Java™ Application Development on Linux - Dator

Java™ Application Development on Linux - Dator

Java™ Application Development on Linux - Dator

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

242Chapter 10Integrated <str<strong>on</strong>g>Development</str<strong>on</strong>g> Envir<strong>on</strong>mentsTherefore, any third-party JARs that you may need for your project shouldbe mounted.To mount a local directory as a filesystem, right-click <strong>on</strong> the little ic<strong>on</strong> labeledFilesystems in the Explorer [Filesystems] window. Choose Mount, thenLocal Directory, and you’ll get a filechooser to let you navigate your filestructure and choose a directory to mount.IMPORTANTTo ensure that NetBeans knows how to compile your source, you need to mountthe directory that c<strong>on</strong>tains the base level of your source as a mountpoint, notjust have that directory somewhere in a tree of directories.For example, let’s say that your source is kept in two packages,com.coolco.projecta and com.coolco.util which implies that youhave a directory structure with those names. Let’s further assume that you keepthem in a directory called src which is itself c<strong>on</strong>tained in a directory calledbrolly, as shown in Figure 10.3.The likely thing to do is to mount the brolly directory, since it will c<strong>on</strong>tainthe source and all sorts of other project-related directories. That’s fine, as faras it goes. But since the mountpoints in NetBeans are also the CLASSPATHdirectories, you need to also mount brolly/src, so that directories likecom/coolco/util are found when your Java sources have statements suchas import com.coolco.util.*;.It’s OK to have the same directory show up in different mountpoints. Net-Beans w<strong>on</strong>’t get c<strong>on</strong>fused, although you may. You’ll probably want to edit andcompile from the mountpoint of, in this example, brolly/src. The src folderinside the brolly mountpoint would refer to the same files. Just keep the <strong>on</strong>ealways open and the other closed, and you should be able to keep them straight.10.2.3.1 Filesystem versus ProjectThe Explorer window has tabs at the bottom which let you look at differentaspects of your work. In some instances you’ll want the Project view. For this,you have to mount file’s from the already mounted filesystems in the Filesystemview. Seems redundant, no? The Project view lets you set properties forthe project as a whole or for individual files in the project. These settings applyto that file <strong>on</strong>ly for the project. Another project, looking at the same files, mighthave different settings.For now, d<strong>on</strong>’t worry about the difference. Many people like to work inthe Filesystem view and never bother with projects. Others, especially thoseworking <strong>on</strong> multiple products or projects, like Projects as a way to switch

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!