Jump to content
xisto Community
Sign in to follow this  
.:Brian:.

Java Sdk Vs. Java Jdk? What is the difference?

Recommended Posts

Ok, so previously I had installed the java SKD on my computer (the one that comes with netbeans), as of right now it is version 1.4.2_13 and I really didn't pay much attention to the version. Everything seemed to work ok for what I was doing, although I wasn't using netbeans, instead I have been using eclipse. (Since I am doing this for a class at school and that is their IDE of choice)Anyway my programs have to compile at the command line (not just work in eclipse). I have been able to get them to work in eclipse fine, but I am having trouble when I go to the command line. Specifically with things such as the Scanner class (which was introduced in java 1.5), and so noticing that I have the SDK of version 1.4...I was thinking that was the problem. But what I can't figure out, is that that seems to be the latest version available on Sun's website. Do I have to download the JDK? (That is of the same version as the Java Runtime Environment).It just doesn't make much sense to me right now....why is eclipse working, but yet I can' compile at the command line? (I have gotten it a little further by including the JRE jar directory in the classpath directory, but that spits out errors about version numbers)So do I simply have to uninstall the Java SDK, and install the JDK? If so, why is it that eclipse is working just fine for me?

Share this post


Link to post
Share on other sites

Ok, so previously I had installed the java SKD on my computer (the one that comes with netbeans), as of right now it is version 1.4.2_13 and I really didn't pay much attention to the version. Everything seemed to work ok for what I was doing, although I wasn't using netbeans, instead I have been using eclipse. (Since I am doing this for a class at school and that is their IDE of choice)
Anyway my programs have to compile at the command line (not just work in eclipse). I have been able to get them to work in eclipse fine, but I am having trouble when I go to the command line. Specifically with things such as the Scanner class (which was introduced in java 1.5), and so noticing that I have the SDK of version 1.4...I was thinking that was the problem. But what I can't figure out, is that that seems to be the latest version available on Sun's website. Do I have to download the JDK? (That is of the same version as the Java Runtime Environment).

It just doesn't make much sense to me right now....why is eclipse working, but yet I can' compile at the command line? (I have gotten it a little further by including the JRE jar directory in the classpath directory, but that spits out errors about version numbers)

So do I simply have to uninstall the Java SDK, and install the JDK? If so, why is it that eclipse is working just fine for me?


Probably a few things. For one, eclipse manages your classpath for you so you don't need to fill your classpath with all the jars. You may be missing a jar on the commandline. Also, you may be compiling 1.5 code with a 1.4 compiler...this also will not work. Use javac -version to determine what version of the compiler you're using. If it's 1.4, you need to tweak your path so that it points to a 1.5 javac.

So you know, eclipse doesn't use javac -- it uses an internal line-by-line compiler (which is why you can still run applications in eclipse if they have errors, you can't do this with netbeans.

Share this post


Link to post
Share on other sites

Yep that was my problem, all I had installed was the java 1.4 compiler. So I uninstalled that and went and get the java JDK which included a newer compiler, and everything worked like a charm. And thanks for letting me know that eclipse doesn't use javac, that now makes sense as to why it was working perfectly fine, and why the command line compiling wasn't.This is an off-topic question somewhat, but as of now I have been starting to prefer using eclipse over netbeans. However, I was wondering what IDE you recommend (if any)? (Do you like eclipse, netbeans, something else?) I am just sort of curious, since although my school chooses to use eclipse for giving examples of how to do things, you can use whatever you want to program in java with, as you simply turn in the .java source code files located in the correct directories according to their packages...and so I can really use any IDE i choose.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.