Saturday 15 June 2013

javac compile error on java.lang.NoClassDefFoundError -


I try to write some code to learn how to use protocol buffers in Java and here's the folder structure:

  - java - com - game - counting - gameempropos.java - info - gemphofotos.java - java_test.java - protobuf-java-2.5.0.jar  

JAVA_TEST.java:

Import com.game.info.GameInfoProtos; Public level zva_test {public static zero main (string [] arg) {}}

and how I compile (no error or warning):

 < Code> Javac JAVA_TEST.java ./com/game/info/GameInfoProtos.java ./com/game/enumeration/GameEnumProtos.java -classpath protobuf-java-2.5.0.jar  

And when I got the error I tried to run the code:

  "Junk". >  

Any help would be appreciated, thanks :)

I have tried what you suggested (macos) running

  java - cp protobuf-java- 2.5.0.jar: com.game.info.GameInfoProtos .JAVA_TEST  

, but got the error in the "Java" folder:

  Error: main Could not find or load class .JAVA_TEST  


No comments:

Post a Comment