Compile Error

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • fnbhns
    New Member
    • Dec 2007
    • 7

    Compile Error

    Dear Friends

    I am new in Java. I use TextPad to write the code & I save in a folder. Before when I used to save the source code with one name, with the same name it would creat a class file after compilation. But now this class file is not creating & showing so many errors. Regarding this Expecting your help.

    Ex : Source code name is Prime.Java
    after compilation new file Prime.class
  • Laharl
    Recognized Expert Contributor
    • Sep 2007
    • 849

    #2
    If you're saving in a different folder, you may need to add it to your classpath. Other than that, it sounds like you're getting compile-time errors in your code. Can we see the code and some of the errors?

    Comment

    • fnbhns
      New Member
      • Dec 2007
      • 7

      #3
      Originally posted by Laharl
      If you're saving in a different folder, you may need to add it to your classpath. Other than that, it sounds like you're getting compile-time errors in your code. Can we see the code and some of the errors?

      Dear Friend

      Many thanks for your reply. But I saved the source code in the same folder. In the coding there is no problem. now after compilation the file with xxx .class extention not creating but before it were creating automatically. I belive too that Classpath changed. But how can I change the classpath & it will be like before, I need your help. Once again like to say thanks.

      Comment

      • r035198x
        MVP
        • Sep 2006
        • 13225

        #4
        Originally posted by fnbhns
        Dear Friend

        Many thanks for your reply. But I saved the source code in the same folder. In the coding there is no problem. now after compilation the file with xxx .class extention not creating but before it were creating automatically. I belive too that Classpath changed. But how can I change the classpath & it will be like before, I need your help. Once again like to say thanks.
        Does your progran reference other classes? If so then those classes need to be in the classpath. You can set that during compilation by giving -classpath <pathToClasse s> flag to the javac command.

        Comment

        Working...