简体   繁体   English

Javac无法正常工作,或者我做错了什么?

[英]Javac not working properly or am I doing something wrong?

I've gotten my friend's project folder that a bunch of .java and .class files so that I could help him with his project. 我已经得到了我朋友的项目文件夹,其中包含一堆.java和.class文件,以便为他的项目提供帮助。 We are using git as our way of version control. 我们使用git作为版本控制的方式。

In the directory, I typed "javac *.java" but unfortunately I got a bunch of class reference errors, so I tried compiling them individually. 在目录中,我键入了“ javac * .java”,但不幸的是我遇到了一堆类引用错误,因此我尝试单独编译它们。

"javac A.java", which extends B, raised an error saying that it couldn't find symbol: class B. So I did "javac B.java" which did just fine, and then tried javac A.java again. 扩展了 B的“ javac A.java”提出了一个错误,指出它找不到符号:类B。因此,我做了“ javac B.java”,它做得很好,然后再次尝试了javac A.java。 The same error popped up saying that it couldn't find symbol: class B. 弹出同样的错误,提示它找不到符号:B类。

Does anyone know what's wrong, and what I should do? 有谁知道怎么了,我该怎么办?

You should reference your classpath on the commandline. 您应该在命令行上引用类路径。 If all the classes are in your current directory, try javac -classpath . *.java 如果所有类都在当前目录中,请尝试javac -classpath . *.java javac -classpath . *.java

Why don't you use ant or maven to compile your stuff? 您为什么不使用ant或maven来编译您的东西? You'll save yourself a lot of headache. 您会省去很多麻烦。

I've had to do same bunch decoding problem. 我不得不做同样的束解码问题。

I'm not a good ant or maven user, so I let Eclipse manage them for me. 我不是一个很好的ant或maven用户,所以我让Eclipse为我管理它们。

All warnings your are looking at will be clearly estimated and referenced before compiling and you will have tool to correct them. 编译之前,所有正在查看的警告都会得到明确的估计和引用,您将拥有纠正它们的工具。

Take few time to have the basic knowledge of Eclipse will give you coherence, and the code corrected will be readable by anyone, you work will be usefull. 花费一些时间掌握Eclipse的基础知识将为您提供连贯性,并且更正后的代码将为任何人可读,您的工作将非常有用。

Later you can look at other Eclipse tools like SVN to manage versionning, or listed in References menu item. 稍后,您可以查看其他Eclipse工具(例如SVN)来管理版本控制,或在“引用”菜单项中列出。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 JPanel setColor()重复无法正常工作,或者我做错了什么? - JPanel setColor() repeatation is not working properly or am I doing something wrong? Fortnite Tracker API似乎无法正常运行,或者我做错了什么? - Fortnite Tracker API seems not to be working or I am doing something wrong? Tomcat maxthreads,我做错了什么吗? - Tomcat maxthreads, am I doing something wrong? 编译器中的错误或我做错了什么? - Bug in compiler or am I doing something wrong? 为什么“包含”项不起作用? 还是我做错了? - Why is the 'contains' not working? or I am doing it wrong? 我的try-catch代码块做错什么了吗? - Am I doing something wrong with my try-catch block? 这是 Jackson JsonParser 中的错误,还是我做错了什么? - Is this a bug in the Jackson JsonParser, or am I doing something wrong? DBSCAN群集算法无法正常工作。 我究竟做错了什么? - DBSCAN clustering algorithm not working properly. What am I doing wrong? 没有命名为EntityManager的持久性提供程序-我做错了什么? - No Persistence provider for EntityManager named - I am doing something wrong? “ For”循环停止正常工作(或者我做错了什么) - “For”-loop ceases to work properly (or I'm doing something wrong)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM