좋습니다. 나는 일주일 전에 자바에 관한 책을 주문했다. (Sams는 21 일 동안 자바를 가르친다.) 그리고 그것은 어제 들어왔다. 내가 처음 예제 코드 일하고, 나는 주요 코드를 컴파일 할 때이 오류가 점점 계속 :JDK 문제 - 클래스 파일을로드 할 수 없습니다.
C:\VolcanoApplication.java:5: error: cannot find symbol
VolcanoRobot dante = new VolcanoRobot();
^
symbol: class VolcanoRobot
location: class VolcanoApplication
C:\VolcanoApplication.java:5: error: cannot find symbol
VolcanoRobot dante = new VolcanoRobot();
^
symbol: class VolcanoRobot
location: class VolcanoApplication
그리고 임 컴파일을 시도하는 주요 코드 것은 :
public class VolcanoApplication
{
public static void main(String[] arguments)
{
VolcanoRobot dante = new VolcanoRobot();
dante.status = "exploring";
dante.speed = 2;
dante.temperature = 510;
dante.showAttributes();
System.out.println("Increasting speed to 3.");
dante.speed = 3;
dante.showAttributes();
System.out.println("Changing temperature to 670.");
dante.temperature = 670;
dante.showAttributes();
System.out.println("Checking the temperature.");
dante.checkTemperature();
dante.showAttributes();
}
}
과 VolcanoRobot.java 파일 :
public class VolcanoRobot
{
String status;
int speed;
float temperature;
void checkTemperature()
{
if(temperature > 660)
{
status = "returning home";
speed = 5;
}
}
void showAttributes()
{
System.out.println("Status: " + status);
System.out.println("Speed: " + speed);
System.out.println("Temperature: " + temperature);
}
}
나는 (내가 XP를 실행하는거야) 명령 프롬프트에서 어디서든 실행 javac의를 얻을 수 없습니다입니다
그래서 나는 내 javac.exe가 (C 곳으로 이동 : \ 프로그램 파일 \ 자바 \ jdk1.7.0_03 \ bin) 및 VolcanoApp 컴파일 거기에서의 화술 (VolcanoApplication은 C의 루트에서 발견된다. :)
자바를 입력하면 어디서나 자바를 입력 할 수 있지만 javac는 메뉴가 아니다. 경로와 클래스 경로 변수를 선언했지만 아직 작동하지 않습니다. 어떤 제안?
@ Alex St-Laurent : IDE를 설치하고 실제 문제에 집중하십시오. – Jayan
죄송합니다. 뭐라고 요? –
@ Alex St-Laurent : 책에서 시작했다고 언급했습니다. 내 의견은 IDE를 사용하여 실제 문제에 집중할 수 있습니다. intelliJ : http://www.jetbrains.com/idea/를 사용해보십시오. 또는 식. – Jayan