• 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

  • 相关阅读:
    01Tensorflow学习之Tensorflow基本介绍
    C#四舍五入说明
    3类与对象——重拾Java
    1Java语言概述——重拾Java
    Android 字体效果
    Python相关资料收集
    2013.11.23思科研发中心面试
    【转】理解同步与异步
    OpenCV中的SURF算法介绍
    OpenCV中Kinect的使用(3)
  • 原文地址:https://www.cnblogs.com/mill2002/p/475133.html
Copyright © 2020-2023  润新知