简体   繁体   English

在Windows命令提示符下无法使用javac编译.java文件

[英]Unable to compile .java file using javac at Windows command prompt

I am trying to compile LoginTest_Chrome.java using javac at Windows command prompt. 我试图在Windows命令提示符下使用javac编译LoginTest_Chrome.java Prior to this, I have set my Environment's classpath to be associated with all the .jar library files, such as Apache POI and Selenium . 在此之前,我已经将我的Environment的类路径设置为与所有.jar库文件关联,例如Apache POI和Selenium

Using echo %classpath% , this is the result of my classpath Environment : 使用echo %classpath% ,这是我的类路径环境的结果:

在此处输入图片说明

Then, I execute javac LoginTest.java and I got the following result : 然后,我执行javac LoginTest.java并得到以下结果

在此处输入图片说明

Hope to have advice from experts here on how to resolve this issue which has bugged me for two days. 希望从这里获得专家的建议,以解决这个困扰了我两天的问题。

Error message after javac *.java : javac *.java之后的错误消息:

Start.java:63: error: cannot find symbol tc = row.getCell(0).toString();
                                         ^ symbol: variable tc location: class Start
Start.java:64: error: cannot find symbol username = row.getCell(1).toString();
                                         ^ symbol: variable username location: class Start
Start.java:65: error: cannot find symbol password = row.getCell(2).toString();
                                         ^ symbol: variable password location: class Start

The problem is not with the compiler itself but with your source code. 问题不在于编译器本身,而在于您的源代码。 If you take a look at the first Error it says 如果您看一下第一个错误,它会说

LoginTest_Chrome.java:76: error cannot find symbol
   LoginCredentials.getFile();

which means that the LoginCredentials variable you are trying to use at line 76 wasn't declared somewhere, or it's somewhere the compiler can't see it (in another .java file maybe?) 这意味着您在第76行尝试使用的LoginCredentials变量未在某处声明,或者在编译器看不到的地方(可能在另一个.java文件中)?

All the other errors mean the same. 所有其他错误的含义相同。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM