Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Why doesn't this code work in Netbeans 7.0?

 
Greenhorn
Posts: 3
Netbeans IDE Chrome
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When I run the following code which I got from Head First Java (it uses Java 5.0, by the way), I get the following error:
run:
Exception in thread "main" java.lang.RuntimeException: Uncompilable source code - Erroneous sym type: Accum.getAccum
at ThreadOne.<init>(TestThreads.java:27)
at TestThreads.main(TestThreads.java:18)
Java Result: 1
BUILD SUCCESSFUL (total time: 2 seconds)

Here is the code:



Can anybody help me with this problem? I have marked the problem lines, by the way.
 
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Errors are at lines 64 and 79. They both are , but should be
 
Michael Kenning
Greenhorn
Posts: 3
Netbeans IDE Chrome
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Andrey Kozhanov wrote:Errors are at lines 64 and 79. They both are , but should be



Thanks! That helped a lot! But now I am getting the following error:

run:
Exception in thread "main" java.lang.RuntimeException: Uncompilable source code - Erroneous sym type: Accum.getAccum
at ThreadOne.<init>(TestThreads.java:27)
at TestThreads.main(TestThreads.java:18)
Java Result: 1
BUILD SUCCESSFUL (total time: 1 second)

What does "Erroneous sym type" mean?
 
Sheriff
Posts: 21972
106
Eclipse IDE Spring VI Editor Chrome Java Ubuntu Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No idea. After fixing those two catch errors the code compiles just fine on my system (Windows 7, JDK 1.6.0_25). The results are random though, but that makes sense since there is no synchronization on the updating of the counter.
 
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No exceptions/errors found. I tried on windows xp with jdk 1.6
 
No more fooling around. Read this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic