• Post Reply Bookmark Topic Watch Topic
  • New Topic

Downloading Java2 classes from java.sun.com  RSS feed

 
Klaas Vredevort
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I was wondering: if there is a class in Java on the site (Java 2 console) that I would like to use in my prog, is there any way I could download it if it dont have it (where do i save it etc) and will my program (Ready To Program) be able to handle it?

Klaas
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not sure I understand. Are you talking about some Java API that is not part of the JDK, but which you would like to use? Then yes, they are all downloadable from java.sun.com. Add them to your classpath, and you can use them. If it's something else you're talking about, then maybe you could give an example of what kind of class that would be.
 
Klaas Vredevort
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, yes. Will the java 2 platform methods and classes work in my IDE (I don't know whether or not Java 2 is a language seperate from Java...). If they will, how do i download the classes from the sun.com website for it to work in my IDE? (e.g. where do i save it to, and more importantly: WHERE can I find it and what part of the file do I save to hard disk?)

Klaas
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Java and Java 2 are the same. There used to be a Java 1.0 and 1.1 before Java 2, but that was a long time ago. These days it's officially called "Java 5", although you can still see references to Java 2 all over the place.

If you have a Java JDK on your machine, you should not need to download anything else to use it in your IDE. It doesn't matter whether you develop in an IDE or using the command line.
If you have no JDK on you machine, the IDE will complain soon enough (most likely it's written in Java anyway, and wouldn't be able to run without it).

Are you experiencing any problems using your IDE?
 
Klaas Vredevort
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, I'm not. I use Ready To Program with Java Technology and it works just fine. I'm still a bit in the dark about what files to download from the java website, though. I think my class library etc is a bit outdated, for instance my computer knows of no java.util.Scanner.*; class, even if I type
import java.util.Scanner.*;

Many people on this site give me advice on using these classes when I program, but I don't have them...

THATS what I want!

Klaas
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It sounds like you have an older JDK. You can download Java 5.0 here (the "JDK 5.0 Update 6"). After you run the installer, your IDE should give you the option of either using the old JDK or the new one. If you're sure you don't need the old one any more, you might as well uninstall it, in order to avoid any possible confusion between the two.
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you're really typing

import java.util.Scanner.*;

that's wrong. The ".*" means "all the classes in a package", implying that Scanner is a package, or group of classes. But it's not; it's a single class. The proper syntax to import it is just

import java.util.Scanner;

Give that a try. If it doesn't work, then you may indeed need to download a newer JDK, as suggested.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!