在mac上用其他类文件编译jar文件(命令:javac-cp“;queue.jar”*.java)?
我尝试了这些命令,但似乎找不到与此程序相关的sevral类 我试过了在mac上用其他类文件编译jar文件(命令:javac-cp“;queue.jar”*.java)?,java,jar,Java,Jar,我尝试了这些命令,但似乎找不到与此程序相关的sevral类 我试过了 javac -cp ".;queue.jar" *.java 及 当我使用第一个时,这就是它给我的 即使CD、KeyedItem、QueueInterface和它抱怨的其他类。CD、KeyedItem和QueueInterface是.class文件 如果删除引号会发生什么?当我删除引号时,它会给我javac。;queue.jar*.java javac:无效标志:。用法:javac use-help获取可能选项的列表-bas
javac -cp ".;queue.jar" *.java
及
当我使用第一个时,这就是它给我的
即使CD、KeyedItem、QueueInterface和它抱怨的其他类。CD、KeyedItem和QueueInterface是.class文件
如果删除引号会发生什么?当我删除引号时,它会给我javac。;queue.jar*.java javac:无效标志:。用法:javac use-help获取可能选项的列表-bash:queue.jar:command-not-found我想我可能已经发现了问题。它应该是“:”而不是“;”在mac上。我今天就来试试。你应该包括-cp标志,但是是的,你需要更改路径分隔符,很好;我想这就是问题所在。谢谢谢谢,我试过了,效果很好。
javac -cp "/"pathName/queue.jar" *.java
BSTDriver.java:25: error: cannot find symbol
private static CD[] readMusic(String fileName)
^
symbol: class CD
location: class BSTDriver
BinarySearchTree.java:11: error: cannot find symbol
public KeyedItem retrieve(Comparable searchKey)
^
symbol: class KeyedItem
location: class BinarySearchTree
BinarySearchTree.java:46: error: cannot find symbol
public void insert(KeyedItem item) throws TreeException
^
symbol: class KeyedItem
location: class BinarySearchTree
BinarySearchTree.java:58: error: cannot find symbol
protected KeyedItem retrieveItem(TreeNode tNode, Comparable searchKey)
^
symbol: class KeyedItem
location: class BinarySearchTree
BinarySearchTree.java:92: error: cannot find symbol
protected TreeNode insertItem(TreeNode tNode, KeyedItem item) throws TreeException
^
symbol: class KeyedItem
location: class BinarySearchTree
BinarySearchTree.java:292: error: cannot find symbol
protected KeyedItem findLeftmost(TreeNode tNode)
^
symbol: class KeyedItem
location: class BinarySearchTree
SearchTreeInterface.java:34: error: cannot find symbol
public void insert(KeyedItem item) throws TreeException;
^
symbol: class KeyedItem
location: interface SearchTreeInterface
SearchTreeInterface.java:49: error: cannot find symbol
public KeyedItem retrieve(Comparable searchKey);
^
symbol: class KeyedItem
location: interface SearchTreeInterface
BinaryTreeIterator.java:1: error: package queue does not exist
import queue.*;
^
BinaryTreeIterator.java:6: error: cannot find symbol
private QueueInterface items;
^
symbol: class QueueInterface
location: class BinaryTreeIterator
BSTDriver.java:9: error: cannot find symbol
CD[] cds = CD.readMusic(args);
^
symbol: class CD
location: class BSTDriver
BSTDriver.java:9: error: cannot find symbol
CD[] cds = CD.readMusic(args);
^
symbol: variable CD
location: class BSTDriver
BSTDriver.java:10: error: cannot find symbol
BinarySeachTree bst = new BinarySearchTree();
^
symbol: class BinarySeachTree
location: class BSTDriver
BSTDriver.java:13: error: cannot find symbol
for(Cd c: cds)
^
symbol: class Cd
location: class BSTDriver
BSTDriver.java:27: error: cannot find symbol
FileIO file = new FileIO(fileName, FileIO.FOR_READING);
^
symbol: class FileIO
location: class BSTDriver
BSTDriver.java:27: error: cannot find symbol
FileIO file = new FileIO(fileName, FileIO.FOR_READING);
^
symbol: class FileIO
location: class BSTDriver
BSTDriver.java:27: error: cannot find symbol
FileIO file = new FileIO(fileName, FileIO.FOR_READING);
^
symbol: variable FileIO
location: class BSTDriver
BSTDriver.java:29: error: cannot find symbol
ArrayList<CD> cds = new ArrayList<CD>();
^
symbol: class CD
location: class BSTDriver
BSTDriver.java:29: error: cannot find symbol
ArrayList<CD> cds = new ArrayList<CD>();
^
symbol: class CD
location: class BSTDriver
BSTDriver.java:36: error: cannot find symbol
CD cd = new CD(title, str, year, rating, numTracks);
^
symbol: class CD
location: class BSTDriver
BSTDriver.java:36: error: cannot find symbol
CD cd = new CD(title, str, year, rating, numTracks);
^
symbol: class CD
location: class BSTDriver
BSTDriver.java:54: error: cannot find symbol
CD[] cds_array = new CD[cds.size()];
^
symbol: class CD
location: class BSTDriver
BSTDriver.java:54: error: cannot find symbol
CD[] cds_array = new CD[cds.size()];
^
symbol: class CD
location: class BSTDriver
BSTDriver.java:56: error: cannot find symbol
for(CD cd : cds)
^
symbol: class CD
location: class BSTDriver
BinarySearchTree.java:19: error: cannot find symbol
KeyedItem item = retrieveItem(getRootNode(),"Asphyx");
^
symbol: class KeyedItem
location: class BinarySearchTree
BinarySearchTree.java:38: error: cannot find symbol
it =(KeyedItem) it.next();
^
symbol: class KeyedItem
location: class BinarySearchTree
BinarySearchTree.java:62: error: cannot find symbol
KeyedItem treeItem;
^
symbol: class KeyedItem
location: class BinarySearchTree
BinarySearchTree.java:70: error: cannot find symbol
KeyedItem nodeItem = (KeyedItem) tNode.getItem();
^
symbol: class KeyedItem
location: class BinarySearchTree
BinarySearchTree.java:70: error: cannot find symbol
KeyedItem nodeItem = (KeyedItem) tNode.getItem();
^
symbol: class KeyedItem
location: class BinarySearchTree
BinarySearchTree.java:104: error: cannot find symbol
KeyedItem nodeItem = (KeyedItem)tNode.getItem();
^
symbol: class KeyedItem
location: class BinarySearchTree
BinarySearchTree.java:104: error: cannot find symbol
KeyedItem nodeItem = (KeyedItem)tNode.getItem();
^
symbol: class KeyedItem
location: class BinarySearchTree
BinarySearchTree.java:137: error: cannot find symbol
KeyedItem nodeItem = (KeyedItem)tNode.getItem();
^
symbol: class KeyedItem
location: class BinarySearchTree
BinarySearchTree.java:137: error: cannot find symbol
KeyedItem nodeItem = (KeyedItem)tNode.getItem();
^
symbol: class KeyedItem
location: class BinarySearchTree
BinarySearchTree.java:221: error: variable right is already defined in method is_Balanced()
TreeNode right = root.getRight();
^
BinarySearchTree.java:222: error: variable left is already defined in method is_Balanced()
TreeNode left = root.getLeft();
^
BinarySearchTree.java:224: error: method getHeight in class BinarySearchTree cannot be applied to given types;
int left_height = getHeight(right);
^
required: TreeNode
found: boolean
reason: actual argument boolean cannot be converted to TreeNode by method invocation conversion
BinarySearchTree.java:225: error: method getHeight in class BinarySearchTree cannot be applied to given types;
int right_height = getHeight(left);
^
required: TreeNode
found: boolean
reason: actual argument boolean cannot be converted to TreeNode by method invocation conversion
BinarySearchTree.java:284: error: cannot find symbol
KeyedItem replacementItem = findLeftmost(tNode.getRight());
^
symbol: class KeyedItem
location: class BinarySearchTree
BinarySearchTree.java:296: error: cannot find symbol
return (KeyedItem)tNode.getItem();
^
symbol: class KeyedItem
location: class BinarySearchTree
BinaryTreeIterator.java:11: error: cannot find symbol
items = new QueueLinked();
^
symbol: class QueueLinked
location: class BinaryTreeIterator
BinaryTreeIterator.java:25: error: cannot find symbol
catch (QueueException e)
^
symbol: class QueueException
location: class BinaryTreeIterator
BinaryTreeIterator.java:88: error: cannot find symbol
QueueInterface<TreeNode> q = new QueueLinked<TreeNode>();
^
symbol: class QueueInterface
location: class BinaryTreeIterator
BinaryTreeIterator.java:88: error: cannot find symbol
QueueInterface<TreeNode> q = new QueueLinked<TreeNode>();
^
symbol: class QueueLinked
location: class BinaryTreeIterator
43 errors