Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

runtime error

 
lokesh rajarathnam
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);
}
}
 
Bob Ruth
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?
 
Carl Wauters
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
 
camilo lopes
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