• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

class not found error

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello everyone. I really think this is a very great place to talk about java. I have this problem anytime i'm compiling, i have to save the name of my program as "myProgram.java". Please, i would like to know how i can solve this problem. Thank you very much for your assistance.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What IDE are you using? In Java, your filename must be the same with your public class. Should you check whether your IDE set your classname by default ?
 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
are you having the problem when you are compiling or when you are attempting to execute the program after compiling? class not found errors usually come during the execution process using the java interpretter.

can you cut/paste the exact command and error you are getting into a note?
 
Kene Francis
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The filename is always the same with my public class. The problem really is that anytime i have to save my programs, they have to be between qoutes. For example: "myProgram.java" . If i don't do it this way, i'll receive error when compiling, and if i check the icon it's with the extension .txt instead of .java. Besides that though, they run compile and run perfectly. Thank you very much for your assistance.
 
lowercase baba
Posts: 13089
67
Chrome Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
are you using Notepad? if so, when you save, there are two (maybe 3) boxes at the bottom. one is the filename, the other is the file type. if the type is set to ".txt", Notepad appends that to the end of the name, unless you put it in double quotes (which sounds like what you're saying.

if you change that bottom box to "all files" (or whatever), then you don't have to use quotes.
 
Ranch Hand
Posts: 815
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A minor subnote... convention calls for classes to be capitalized, thus MyProgram.java, as opposed to myProgram.java
 
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to JavaRanch, Kene!

Your problem possibly surrounds a "feature" of the Windows operating sytem, where it hides file extensions from you because it thinks you're now bright enough to understand them.

Follow these steps to turn off this feature, if you like:
  • Open any Windows explorer (not internet explorer) window.
  • In the "Tools" menu, select "Folder Options..."
  • In the "View" tab of the "Folder Options" window, deselect the "Hide extensions for known file types" option.
  • Click "Apply"
  • Click "Apply to All Folders"
  • Success?
     
    Dirk Schreckmann
    Sheriff
    Posts: 7023
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Moving this to the General Computing forum...
     
    reply
      Bookmark Topic Watch Topic
    • New Topic