zoukankan      html  css  js  c++  java
  • how to compile source code of "Data Structures & Algorithm Analysis in Java" writen by Mark Allen Weiss

     how to compile source code of "Data Structures & Algorithm Analysis in Java" writen by Weiss
        Another question:How to demo the examples under  folder of DataStructures?

        a) put a build.xml file in the folder the source code in
        b) type 'ant' in command line
        c) i just made a one copy of build.xml from another place and put it in same folder of source code.
                 only one thing about 'property name="srcdir" value="src"'  is to be concerned.
        d) when compiling source code of the folder named Miscellaneous, first i copied all of the source code into
                 folder named src,then type ant in command line and appeared 36 errors which of them displays
                 [javac] K:\game\tutorial\CodeWin\src\Concordance2.java:3: package DataStructures does not exist
                 [javac] import DataStructures.*;
          This indicates the source code of Miscellaneous needs package named DataStructures.
          Then i copy folder of DataStructures into folder of src and type ant again,this time show
               'Success'

         要在命令行中run the examples under folder of DataStructures,note a sentence of 'package DataStructure;' in the source code file, so must tell  java.exe find some class (such as LinkedList) under folder of DataStructure. in Command Line,should type "java DataStructures/LinkedList",if entry the DataStructures by command of 'cd DataStructures' and then type 'java LinkedList' you will see the followings:
         K:\game\tutorial>cd codewin/DataStructures
         K:\game\tutorial\CodeWin\DataStructures>java LinkedList
         Exception in thread "main" java.lang.NoClassDefFoundError: LinkedList (wrong nam
            e: DataStructures/LinkedList)
            at java.lang.ClassLoader.defineClass0(Native Method)
            at java.lang.ClassLoader.defineClass(Unknown Source)
            at java.security.SecureClassLoader.defineClass(Unknown Source)
            at java.net.URLClassLoader.defineClass(Unknown Source)
            at java.net.URLClassLoader.access$100(Unknown Source)
            at java.net.URLClassLoader$1.run(Unknown Source)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.net.URLClassLoader.findClass(Unknown Source)
            at java.lang.ClassLoader.loadClass(Unknown Source)
            at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
            at java.lang.ClassLoader.loadClass(Unknown Source)
            at java.lang.ClassLoader.loadClassInternal(Unknown Source)
         
        Aug.11th,2006

  • 相关阅读:
    控制层与视图层传数据
    (二)程序异常原因汇总、工具
    (十一)C语言中内存堆和栈的区别
    (二)再议MII、RMII、GMII接口
    (一)MII/MDIO接口详解
    (四)单片机系统动态内存分配,任务调度思想
    (十)Linux内核中的常用宏container_of
    (八)C语言结构体和指针
    (七)C语言中的void 和void 指针类型
    (六)C语言之typedef详解
  • 原文地址:https://www.cnblogs.com/mill2002/p/475133.html
Copyright © 2011-2022 走看看