Win a copy of Succeeding with AI this week in the Artificial Intelligence and Machine Learning 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
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
  • Junilu Lacar
Sheriffs:
  • Tim Cooke
  • Jeanne Boyarsky
  • Knute Snortum
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • salvin francis
  • fred rosenberger
  • Frits Walraven

Could not find or load main class StopwatchApplication

 
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to make a stopwatch application in java , but its throwing an error like shown in the picture..


Here's the code





 .... please help
help-3.PNG
[Thumbnail for help-3.PNG]
 
Rancher
Posts: 4553
47
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What command are you using to run it, and is your compiled class file in the stopwatch_package folder?
 
Ranch Hand
Posts: 87
1
VI Editor Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Fully qualified name of your class which you want to run is 'stopwatch_package.StopwatchApplication'. You need to provide in order to run it: And since you're running program without specifying -classpath (default classpath is therefore current directory), you need to run that command ('java stopwatch_package.StopwatchApplication') from parent directory of directory stopwatch_package. Are you running it from such place ?

Based on your picture, in order to run above mentioned command successfully, you should have following directory structure:
[edit]: your classpath is pointing to current directory, if you don't have defined environment variable "CLASSPATH" to some other value
 
Gourav Das
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Miroslav Lehotsky wrote:Fully qualified name of your class which you want to run is 'stopwatch_package.StopwatchApplication'. You need to provide in order to run it: And since you're running program without specifying -classpath (default classpath is therefore current directory), you need to run that command ('java stopwatch_package.StopwatchApplication') from parent directory of directory stopwatch_package. Are you running it from such place ?

Based on your picture, in order to run above mentioned command successfully, you should have following directory structure:
[edit]: your classpath is pointing to current directory, if you don't have defined environment variable "CLASSPATH" to some other value




Thank you , i forgot to put the file i package folder , it works now ... yeah!!
 
Gourav Das
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Dave Tolls wrote:What command are you using to run it, and is your compiled class file in the stopwatch_package folder?



Thank you
 
    Bookmark Topic Watch Topic
  • New Topic