Complile errors with Chapter 5

Discussion & updates on SimpleWeather

Moderator: tbitson

Complile errors with Chapter 5

Postby hpronhovde » Fri May 07, 2010 3:49 pm

I am just starting to build the weather station and learn Java at that the same time. I am using the latest version of java and netbeans 6.8. I copied the TempSensor.java to the source and the file shows up in the IDE. I added:
// sensors
private TempSensor ts1;
lines as shown in the book and get errors:

E:\JavaDev\WeatherToys\SimpleWeather\src\simpleweather\SimpleWeather.java:47: cannot find symbol
symbol : class TempSensor
location: class simpleweather.SimpleWeather
private TempSensor ts1;
E:\JavaDev\WeatherToys\SimpleWeather\src\simpleweather\SimpleWeather.java:90: cannot find symbol
symbol : class TempSensor
location: class simpleweather.SimpleWeather
ts1 = new TempSensor(adapter, TEMP_SENSOR_ID);
E:\JavaDev\WeatherToys\SimpleWeather\src\simpleweather\TempSensor.java:28: cannot find symbol
symbol : variable SimpleWeather
location: class simpleWeather.TempSensor
private static boolean debugFlag = SimpleWeather.debugFlag;
Note: E:\JavaDev\WeatherToys\SimpleWeather\src\simpleweather\SimpleWeather.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
3 errors
E:\JavaDev\WeatherToys\SimpleWeather\nbproject\build-impl.xml:413: The following error occurred while executing this line:
E:\JavaDev\WeatherToys\SimpleWeather\nbproject\build-impl.xml:199: Compile failed; see the compiler error output for details.
BUILD FAILED (total time: 0 seconds)

I can not find anything that explains the errors. Can someone please help me.

TIA,

Ron Ronhovde
hpronhovde
 
Posts: 8
Joined: Sun Apr 25, 2010 12:40 pm

Re: Complile errors with Chapter 5

Postby tbitson » Sun May 30, 2010 6:36 am

Ron,

The key is these lines:

E:\JavaDev\WeatherToys\SimpleWeather\src\simpleweather\TempSensor.java:28: cannot find symbol
symbol : variable SimpleWeather
location: class simpleWeather.TempSensor
private static boolean debugFlag = SimpleWeather.debugFlag;

It states that on line 28 of TempSensor.java it can't find the variable SimpleWeather.debugFlag. Since that variable is defined in SimpleWeather.java, go check the declaration for proper syntax and capitalization:

Code: Select all
public static boolean debugFlag = false;
tbitson
Site Admin
 
Posts: 142
Joined: Mon May 14, 2007 8:09 am
Location: Tucson, AZ

Re: Complile errors with Chapter 5

Postby hpronhovde » Mon May 31, 2010 11:14 am

Thanks Tim,

It was Capitalization. I have not gotten used to the strict rules on capitalization in Java.

Ron
hpronhovde
 
Posts: 8
Joined: Sun Apr 25, 2010 12:40 pm


Return to SimpleWeather

Who is online

Users browsing this forum: No registered users and 1 guest

cron