📄 029-034.html
字号:
<HTML>
<HEAD>
<META name=vsisbn content="1558515682"><META name=vstitle content="Java Digital Signal Processing"><META name=vsauthor content="Douglas A. Lyon"><META name=vsimprint content="M&T Books"><META name=vspublisher content="IDG Books Worldwide, Inc."><META name=vspubdate content="11/01/97"><META name=vscategory content="Web and Software Development: Programming, Scripting, and Markup Languages: Java"><TITLE>Java Digital Signal Processing:Java and Its Promise</TITLE>
<!-- HEADER --><STYLE type="text/css"> <!-- A:hover { color : Red; } --></STYLE><META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
<!--ISBN=1558515682//-->
<!--TITLE=Java Digital Signal Processing//-->
<!--AUTHOR=Douglas A. Lyon//-->
<!--PUBLISHER=IDG Books Worldwide, Inc.//-->
<!--IMPRINT=M & T Books//-->
<!--CHAPTER=1//-->
<!--PAGES=029-034//-->
<!--UNASSIGNED1//-->
<!--UNASSIGNED2//-->
<CENTER>
<TABLE BORDER>
<TR>
<TD><A HREF="024-029.html">Previous</A></TD>
<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>
<TD><A HREF="034-038.html">Next</A></TD>
</TR>
</TABLE>
</CENTER>
<P><BR></P>
<H4 ALIGN="LEFT"><A NAME="Heading14"></A><FONT COLOR="#000077">Getting Started in Windows 95 with J++</FONT></H4>
<P>In this section we give instructions for compiling the DiffCAD project on an Intel 486DX2 66MHz computer, running Windows NT 4.0 and Microsoft Visual J++ Professional Edition. We have also tested DiffCAD on a Windows 95 machine running on a 166 mmx equipped Pentium P5.
</P>
<BLOCKQUOTE>
<P><FONT SIZE="-1"><HR><B>CD-ROM: </B>Using an application called WinZip, open and uncompress the <B>DIFFCAD.ZIP</B> file on the CD-ROM as shown in Figure 1.16.<HR></FONT>
</BLOCKQUOTE>
<P><A NAME="Fig16"></A><A HREF="javascript:displayWindow('images/01-16.jpg',378,331 )"><IMG SRC="images/01-16t.jpg"></A>
<BR><A HREF="javascript:displayWindow('images/01-16.jpg',378,331)"><FONT COLOR="#000077"><B>Figure 1.16</B></FONT></A> WinZip 6.2 showing a list of files within <B>DIFFCAD.ZIP</B>.
</P>
<P>WinZip was used to expand the files into the D:\work\DiffCAD directory. J++ provides a means to insert files into a project. All the files in the DiffCAD folder must be inserted into the J++ project.
</P>
<P>Create a new project workspace of type <B>Project Workspace</B> in the DiffCAD directory as shown in Figure 1.17. From the Insert menu, select <B>Files into Project…</B> and add all the files in the DiffCAD directory to the project as shown in Figure 1.18.</P>
<P><A NAME="Fig17"></A><A HREF="javascript:displayWindow('images/01-17.jpg',308,192 )"><IMG SRC="images/01-17t.jpg"></A>
<BR><A HREF="javascript:displayWindow('images/01-17.jpg',308,192)"><FONT COLOR="#000077"><B>Figure 1.17</B></FONT></A> Creating a new project workspace in J++.</P>
<P><A NAME="Fig18"></A><A HREF="javascript:displayWindow('images/01-18.jpg',432,333 )"><IMG SRC="images/01-18t.jpg"></A>
<BR><A HREF="javascript:displayWindow('images/01-18.jpg',432,333)"><FONT COLOR="#000077"><B>Figure 1.18</B></FONT></A> Inserting the files from the <I>util</I> package into the project.
</P>
<P>This process takes several passes, because there are too many files to add in one pass (a limitation of the current. version of Developer Studio). Add the source files in the <I>Raytracer</I> and <I>util</I> directories to the project.</P>
<P>From the <B>Build … Settings</B> menu selection, select the <B>Java</B> tab and set the warning level to <B>none</B>. Build and execute the project.</P>
<P>Two subprojects are assigned to the main DiffCAD project: <I>util</I> and <I>Raytracer</I>.</P>
<P>Figure 1.19 shows the <I>jview.exe</I> being invoked automatically by the J++ project manager.</P>
<P><A NAME="Fig19"></A><A HREF="javascript:displayWindow('images/01-19.jpg',572,331 )"><IMG SRC="images/01-19t.jpg"></A>
<BR><A HREF="javascript:displayWindow('images/01-19.jpg',572,331)"><FONT COLOR="#000077"><B>Figure 1.19</B></FONT></A> Starting <B>jview.exe</B> on the <I>MAIN</I> class.
</P>
<H4 ALIGN="LEFT"><A NAME="Heading15"></A><FONT COLOR="#000077">Getting Started on the Mac with JDK 1.0.2</FONT></H4>
<BLOCKQUOTE>
<P><FONT SIZE="-1"><HR><B>CD-ROM: </B>In this section we describe the use of the Java Developers Kit, JDK 1.0.2, which is located on the CD-ROM. You are cautioned to try a different product because this one is freeware and is missing key features of some of the commercial products.<HR></FONT>
</BLOCKQUOTE>
<P>First, double-click on the <B>JDK.sea</B> icon and expand it to your hard drive. You will create a folder that looks like the one shown in Figure 1.20.</P>
<P><A NAME="Fig20"></A><A HREF="javascript:displayWindow('images/01-20.jpg',54,46 )"><IMG SRC="images/01-20t.jpg"></A>
<BR><A HREF="javascript:displayWindow('images/01-20.jpg',54,46)"><FONT COLOR="#000077"><B>Figure 1.20</B></FONT></A> The expanded JDK on disk.</P>
<P>Inside the JDK folder you will find the Java compiler along with the four other items shown in Figure 1.21.
</P>
<P><A NAME="Fig21"></A><A HREF="javascript:displayWindow('images/01-21.jpg',221,266 )"><IMG SRC="images/01-21t.jpg"></A>
<BR><A HREF="javascript:displayWindow('images/01-21.jpg',221,266)"><FONT COLOR="#000077"><B>Figure 1.21</B></FONT></A> The contents of the JDK folder.</P>
<P>To make the Java compiler easier to use, make an alias to it and place it on your desktop. The Java compiler has a drag-and-drop interface, and having an alias will be of direct assistance in its use. Figure 1.22 shows how to find the alias command on the Mac.
</P>
<P><A NAME="Fig22"></A><A HREF="javascript:displayWindow('images/01-22.jpg',146,280 )"><IMG SRC="images/01-22t.jpg"></A>
<BR><A HREF="javascript:displayWindow('images/01-22.jpg',146,280)"><FONT COLOR="#000077"><B>Figure 1.22</B></FONT></A> Finding the alias command on the Mac.</P>
<P>Once the Java compiler is on the desktop, uncompress the DiffCAD directory. An image of the DiffCAD self-extracting archive is shown in Figure 1.9. Your first step is to compile the packages in the DiffCAD directory. There is no support for a UNIX-like Makefile command in the JDK version of the MacOS, so it must be done by hand. Find the two folders in the DiffCAD directory—Raytracer and util—shown in Figure 1.23.
</P>
<P><A NAME="Fig23"></A><A HREF="javascript:displayWindow('images/01-23.jpg',63,89 )"><IMG SRC="images/01-23t.jpg"></A>
<BR><A HREF="javascript:displayWindow('images/01-23.jpg',63,89)"><FONT COLOR="#000077"><B>Figure 1.23</B></FONT></A> The two folders in the DiffCAD directory.</P>
<P>Double-click on the <B>Raytracer</B> folder and drag the Java source code to the Java compiler alias. Package compilation will create a Raytracer class folder near the <B>RayTracer.java</B> file, shown in Figure 1.24.</P>
<P><A NAME="Fig24"></A><A HREF="javascript:displayWindow('images/01-24.jpg',151,67 )"><IMG SRC="images/01-24t.jpg"></A>
<BR><A HREF="javascript:displayWindow('images/01-24.jpg',151,67)"><FONT COLOR="#000077"><B>Figure 1.24</B></FONT></A> The RayTracer class folder.</P>
<P>Move the class files from the RayTracer class folder into the parent folder (also called Raytracer). Repeat this process for the <I>util</I> package. Then, from the DiffCAD folder, select all the source files and drag them to the Java compiler alias. You may run out of memory during the compile. This is normal. Just view the files by name and drag the files with no corresponding class file, a few at a time, onto the Java compiler alias. It’s time-consuming and error-prone. If you miss a file, your program will fail to load. After all the files are loaded, launch the Applet Viewer in the JDK 1.0.2/Applets directory. The Applet Viewer icon is shown in Figure 1.25.</P>
<P><A NAME="Fig25"></A><A HREF="javascript:displayWindow('images/01-25.jpg',78,46 )"><IMG SRC="images/01-25t.jpg"></A>
<BR><A HREF="javascript:displayWindow('images/01-25.jpg',78,46)"><FONT COLOR="#000077"><B>Figure 1.25</B></FONT></A> The Applet Viewer icon.</P>
<P>Select the <B>file:properties</B> in the Applet Viewer and set the class access to <B>Unrestricted</B>, as shown in Figure 1.26.</P>
<P><A NAME="Fig26"></A><A HREF="javascript:displayWindow('images/01-26.jpg',250,177 )"><IMG SRC="images/01-26t.jpg"></A>
<BR><A HREF="javascript:displayWindow('images/01-26.jpg',250,177)"><FONT COLOR="#000077"><B>Figure 1.26</B></FONT></A> Class access must be unrestricted.</P>
<P>The <B>Unrestricted</B> setting will enable DiffCAD to perform otherwise forbidden operations, such as opening a file and saving changes. The default class access is restricted, and it will cause a security manager exception to be thrown during normal DiffCAD usage. As of this writing, JDK 1.0.2 cannot turn off its restrictions on class access. This means that files cannot be opened with the MacOS version of the JDK.</P>
<H4 ALIGN="LEFT"><A NAME="Heading16"></A><FONT COLOR="#000077">Getting Started on the Mac with Symantec Café</FONT></H4>
<P>In this section we describe a product called Symantec Café 1.5 for the PowerPC/MacOS. The IDE consistently emitted the following condition:
</P>
<!-- CODE SNIP //-->
<PRE>
Error: java.lang.OutOfMemoryError
</PRE>
<!-- END CODE SNIP //-->
<P>This error occurs despite the allocation of 26MB to the IDE. The IDE supports the Sun Java compiler as well as the Symantec compiler. Switching to the Sun Java compiler within Symantec Café caused the program to hang.
</P><P><BR></P>
<CENTER>
<TABLE BORDER>
<TR>
<TD><A HREF="024-029.html">Previous</A></TD>
<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>
<TD><A HREF="034-038.html">Next</A></TD>
</TR>
</TABLE>
</CENTER>
<hr width="90%" size="1" noshade><div align="center"><font face="Verdana,sans-serif" size="1">Copyright © <a href="/reference/idgbooks00001.html">IDG Books Worldwide, Inc.</a></font></div>
<!-- all of the reference materials (books) have the footer and subfoot reveresed --><!-- reference_subfoot = footer --><!-- reference_footer = subfoot --></BODY></HTML><!-- END FOOTER -->
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -