• Post Reply Bookmark Topic Watch Topic
  • New Topic

Help me solve few errors  RSS feed

 
Mohammad Ayaz Shaikh
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey guys, I'm learning java from a book called Head First Java. I'm getting errors while compiling my first program. I have jre,jdk 7 on win 7 and open jdk and jre on ubuntu distro, which one should I prefer and why?
here look at those errors
" Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.

C:\Users\Mohammed Ayaz S>cd c:\java\src

c:\java\src>javac MyFirstApp.java
MyFirstApp.java:3: cannot find symbol
symbol : method printIn(java.lang.String)
location: class java.io.PrintStream
{ System.out.printIn("I Rule!");
^
MyFirstApp.java:4: cannot find symbol
symbol : method printIn(java.lang.String)
location: class java.io.PrintStream
System.out.printIn("The World");
^
2 errors

c:\java\src> "

please help me out!


 
Stuie Clarky
Ranch Hand
Posts: 98
Eclipse IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Little tip, stack trace is good, but stack trace and source code is better. However I think in this instance I think you should carefully re-read the book material, especially around the System.out part - hint: it is not a capital 'I'


S

Edit: Aww, missed that.
Welcome anyway
 
Tony Docherty
Bartender
Posts: 3271
82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And Welcome to the Ranch.
 
bala nannaka
Ranch Hand
Posts: 49
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mohammad Ayaz Shaikh wrote:hey guys, I'm learning java from a book called Head First Java. I'm getting errors while compiling my first program. I have jre,jdk 7 on win 7 and
location: class java.io.PrintStream
{ System.out.printIn("I Rule!");
^


Refer java api for methods present in PrintSream class there is typo error in your code.
 
Winston Gutkowski
Bartender
Posts: 10575
66
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
bala nannaka wrote:Refer java api for methods present in PrintSream class there is typo error in your code.

Well spotted bala. I have to admit, it took my old eyes a lot longer than yours.

Winston
 
Tony Docherty
Bartender
Posts: 3271
82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well spotted bala. I have to admit, it took my old eyes a lot longer than yours

Yes a good spot but to be fair to Stuie he spotted it first - and I had intended to congratulate him after his post but got side tracked.
 
fred rosenberger
lowercase baba
Bartender
Posts: 12563
49
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mohammad Ayaz Shaikh,
Your post was moved to a new topic.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!