This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Journey To Enterprise Agility and have Daryl Kulak & Hong Li on-line!
See this thread for details.
Win a copy of The Journey To Enterprise Agility this week in the Agile and Other Processes forum! And see the welcome thread for 20% off.
  • 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:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

runtime error  RSS feed

 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all,

i'm trying interface but the following coad make error
" Exception in thread "main" java.lang.NoclassDefFoundError: Test "
any one can help from this hurdeal

interface Bounceable {

void bounce();
void setBounceFactor(int bf);
}

class Tire implements Bounceable {

public void bounce(){

System.out.println(" defaultly this method will be abstract and public");
}

public void setBounceFactor(int p) {
System.out.println(" what ever access specifier in interface but in implement it will be public");

}
}
class Test {
public static void main (String args[]){

Bounceable oB= new Tire();
oB.bounce();
oB.setBounceFactor(8);
}
}
 
Ranch Hand
Posts: 320
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Look at the class that implements main().
What can you see about it's "visibility" that might get in the way such that the JVM can't find main() to load it?
 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Java can't find your .class files. Make sure the .class files directory is in your classpath (via environment variable CLASSPATH or via adding -cp directoryname in your command line
 
Ranch Hand
Posts: 202
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
it sees where classpath is being its, in annex I placed a tutorial one in Portuguese (you can use a translator) that she teaches to configure the variaveis of environment in less than 5 minutes and to leave everything ok. This error of compilation, is why its archive class was not found.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!