• Post Reply Bookmark Topic Watch Topic
  • New Topic

javac doesn't make any class  RSS feed

 
Radu Catalin
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello, i am a java begginer and i have some problem with javac command. This command doesnt create any class even if i pres javac FileName.java.
I have path set to C:\Program Files\Java\jdk1.8.0_121\bin. Can someone help me? Ask for another information if you need.
 
Tapas Chand
Ranch Hand
Posts: 614
9
BSD Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the ranch
Can you post the exact output after running the command "javac FileName.java"
 
Radu Catalin
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ytb is my file name.
ytb.java:3: error: cannot find symbol
                System.out.prinln("How are you");
                                ^
  symbol:   method prinln(String)
  location: variable out of type PrintStream
1 error



i am not sure if command promt show me () ore <> but this is the error i see
an the code if you need is:
class ytb{
public static void main(String args[]){
System.out.prinln("How are you");
}
}
 
Paweł Baczyński
Bartender
Posts: 2087
44
Firefox Browser IntelliJ IDE Java Linux Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are not getting the class file because your code does not compile.

The compiler is telling you what the problem is:

ytb.java:3: error: cannot find symbol
                System.out.prinln("How are you");
                                ^
  symbol:   method prinln(String)


Take a close look at the method name. If you mistype one letter the compiler will complain. You need to use a proper method name.
 
Radu Catalin
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
my code is made from a bucky tutorial. I am very new and i don't know anything about java yet.
If you can give to me a good java program to test is please do it. I think my code is right.
 
Paweł Baczyński
Bartender
Posts: 2087
44
Firefox Browser IntelliJ IDE Java Linux Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think it is not right.
And, what is more important, the compiler thinks it is not right.

Read the code in the tutorial very carefully, letter by letter. Are you sure it says prinln?
 
Radu Catalin
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok, i am preaty blind. Thankx you a lot :3
 
fred rosenberger
lowercase baba
Bartender
Posts: 12565
49
Chrome Java Linux
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The nice thing about the compiler is that it tells you (usually) where the problem is.  If the compiler prints out "error", the compiler pretty much gave up trying to make your .class file.  Regardless of what you think, it's not right. 

Here's a big hint though...if it ever prints out more than one error, ignore ALL the errors but the first one.  Fix it, then re-compile.  Much of the time, making one error confuses the parser, and it just gets more and more confused until it gives up and reports lots of errors.  But the thing is, if you fix the first one, a lot of the time that will un-confuse the parser, and it can then do a better job of reporting the next error.  Sometimes fixing the one error (like a missing curlie bracket) can fix ten reported errors...
 
Campbell Ritchie
Marshal
Posts: 56599
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Radu Catalin wrote:ok, i am preaty blind. . . .
You mustn't worry about it. Many people make that sort of error. Another similar error is writing printIn with an I instead of the l.
 
Radu Catalin
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thankx you all. By the way, you think it is a good idea to start to lern java at 15? just ask, i want to hear some opinion about this withou making another topic
 
Campbell Ritchie
Marshal
Posts: 56599
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Radu Catalin wrote:thankx you all. By the way, you think it is a good idea to start to lern java at 15?
Yes
just ask, i want to hear some opinion about this withou making another topic
It might have been better to create a second thre‍ad.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!