Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Changes between java versions.

 
Alex Manfredi
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone! I have just registered here. Thanks in advance!

I am having probably a very basic problem, but I can't figure it out myself.

I am trying to learn Java, I got a lot of material about it, but the java they teach are of different versions. I am running Java 6 using Eclipse, and sometimes I get stuck in a very simple exercise like HelloWord or Add2Integers...
I am trying to run an Add2Integers program, but I can't "import acm.program.*" or extend "ConsoleProgram" as the book says, also the "readInt " does not work, where says "println" only works if I use "System.out.println".

I have searched on the java website the syntax changes between the version, or what have changed between the versions, I couldn’t find anything to clarify. One of the videos I downloaded says that using a different version is not a big deal, but it is since I can’t run a simple exercise.

It is probably very simple for who knows, but it is getting me frustrated!

Thanks a lot!




CCNA. But useless in programming.
 
Joanne Neal
Rancher
Posts: 3742
16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Java 6 is the latest version of Java and it is backwards compatible, so any standard Java stuff in your teaching materials should work.

Your problem is that the acm.program package and the ConsoleProgram class are not part of standard Java. They are probably in a third party jar file that you need to include in your classpath when compiling or running your program. Either your teachers or the teaching materials should tell you how to get hold of this jar file.
 
Campbell Ritchie
Sheriff
Pie
Posts: 50258
79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nice to see you again, Joanne. And welcome to the Ranch, Alex Manfredi
 
Alex Manfredi
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Good to know that it is not a syntax that changed or so.

I don't remember they saying where to get those JAR files. I going to look again anyway!

Is there any material that you recommend to someone like me willing to learn programming withoul a programming background?

I feel that sometimes lack of very basic knowledge get me stuck/confused!!


Thanks a lot for you reply!
 
Campbell Ritchie
Sheriff
Pie
Posts: 50258
79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is more about .jar files in this Java™ Tutorials section.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic