• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java in linux

 
sanket karkare
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
when i run the command

java /home/abc/.config/autostart/Test4

i get

Exception in thread "main" java.lang.NoClassDefFoundError: /home/abc//config/autostart/Test4

I think the problem is because a dot represents current directory in java and a hidden file in linux.
So how to resolve the ambiguity.
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The "java" command takes as parameter a class name, not a file name. I think you want something like this (assuming that "Test4" is the class name, and it's not in a package).

java -classpath /home/abc/config/autostart Test4
 
sanket karkare
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, your reply worked
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic