Welcome Guest ( Log In | Register )



 
Reply to this topicStart new topic
> Java Sdk Vs. Java Jdk?, What is the difference?
.:Brian:.
post Sep 24 2007, 06:28 PM
Post #1


Premium Member
Group Icon

Group: Members
Posts: 219
Joined: 13-February 07
Member No.: 20,371



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?
Go to the top of the page
 
+Quote Post
ethergeek
post Sep 24 2007, 09:55 PM
Post #2


Premium Member
Group Icon

Group: [HOSTED]
Posts: 393
Joined: 9-March 07
From: Tucson, AZ
Member No.: 20,794



QUOTE(.:Brian:. @ Sep 24 2007, 11:28 AM) *
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.
Go to the top of the page
 
+Quote Post
.:Brian:.
post Sep 26 2007, 03:23 PM
Post #3


Premium Member
Group Icon

Group: Members
Posts: 219
Joined: 13-February 07
Member No.: 20,371



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.
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. java.lang.NullPointException(4)
  2. Using system date in java... How?(4)
  3. Java Unlimited(14)
  4. Array Sorting(21)
  5. What Are The Advantages Of Java Vs C++?(15)
  6. Need Help: Find Lowest Character Using Java(7)
  7. Download Java Ebooks(13)
  8. Java By Example(8)
  9. Video Streaming In Web Browser Through Java Or Jsp(1)
  10. Looking For A Java IDE(25)
  11. On Why Java Is 'c'ooler!(10)
  12. Other Sound Format Support(3)
  13. Java Phone Book(2)
  14. How To Create Exe File In Java?(12)
  15. How Do I Test A Java Aplication(11)
  1. Mozilla And Java!(2)
  2. Need To Modify Xml Attribute Using Java(4)
  3. Bluetooth And Java(5)
  4. Graphcal User Interfaces In Java(4)
  5. Java Db Help Pls(2)
  6. Loading 3d Models In Java?(2)
  7. Java Applet Loading Error(5)
  8. Setting Up Java Correctly(8)
  9. Java Java.security.accesscontrolexception(6)
  10. Simple Java Question(3)
  11. Java And Sql: Data Mismatch(6)
  12. Java Memory Leak?(0)
  13. Java Mouse Movement.(2)


 



- Lo-Fi Version Time is now: 8th October 2008 - 03:39 AM