This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Two Problems Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Two Problems" Watch "Two Problems" New topic
Author

Two Problems

Sujoy Mukherjee
Ranch Hand

Joined: Dec 31, 2005
Posts: 46

Hello friends, a very happy new year to all of you!
I'm new to this java world. I've two problems to solve out....or should I say a question and a problem?

(1)Concept of JRE
==================
The first one is, I don't understand the concept of jre. What for this jre is used? Ok I know its java runtime environment...and probably its for running the java codes to those machines where java sdk isn't installed....but why we who've installed java sdk also have to install it? And if Iinstall an updated version of jre, then what about the prev. version already installed in my pc? What about that java web start icon?

(2)CLASSPATH Problem
=======================
This one is really bugging me! I already found one post with the same problem...and already tried several solution including Sun's instruction, but without any result. But before that, let me give you a picture of my machine.......>
I've a dual boot system...Win98 SE & WinXP Professional....in both cases, java sdk 1.5.0 beta installed. I got 4 partitions on my hdd, on C:, its win98, on D:, its winXP, I installed java on both C for win98) & E for winXP) & created a folder "javaworld" on E: where I keep all the codes....that's it.

The problem is that when I tried to run java.exe it's giving error -
Exception in Thread "main" java.lang.NoClassDefFoundError
But if I give the command set classpath= from the command line, then it works fine....so I understand its due to my classpath.

Here's my classpath on XP environment -
D:\Program Files\Novosoft\C2J\Bin\c2jruntime.zip;E:\j2sdk1.5.0\lib;E:\j2sdk1.5.0\jre\lib\rt.jar;E:\j2sdk1.5.0\lib\dt.jar;E:\j2sdk1.5.0\lib\tools.jar;
E:\j2sdk1.5.0\jre\lib\ext\sunpkcs11.jar;E:\j2sdk1.5.0\jre\lib\ext\sunjce_provider.jar;E:\j2sdk1.5.0\jre\lib\ext\localedata.jar;
E:\j2sdk1.5.0\jre\lib\ext\dnsns.jar

[line breaks inserted for readability - Jim]

Does anything missing or wrong? Plzz help.
[ January 05, 2006: Message edited by: Jim Yingst ]
Stuart Ash
Ranch Hand

Joined: Oct 07, 2005
Posts: 637
Originally posted by Sujoy Mukherjee:
Hello friends, a very happy new year to all of you!
I'm new to this java world. I've two problems to solve out....or should I say a question and a problem?

(1)Concept of JRE
==================
The first one is, I don't understand the concept of jre. What for this jre is used? Ok I know its java runtime environment...and probably its for running the java codes to those machines where java sdk isn't installed....but why we who've installed java sdk also have to install it? And if Iinstall an updated version of jre, then what about the prev. version already installed in my pc? What about that java web start icon?




Welcome to Java and the Ranch.

JDK = JRE + Developer stuff

I think separate installation of JRE is not necessary if the JDK is already there, the installer's insistence on installing JRE as well along with JDK is perhaps redundant. Others, correct me if I am wrong in my observation.

Classpath problem?? Welcome to Java!!
[ January 05, 2006: Message edited by: Stuart Ash ]

ASCII silly question, Get a silly ANSI.
Sujoy Mukherjee
Ranch Hand

Joined: Dec 31, 2005
Posts: 46

Thankz Stuart. But still one thing isn't cleared about jre. Say I have installed jre 1.4.1, then using the update feature of java icon(on control panel) if I update to jre 1.4.2 or even jre 1.5.0, then what happened to the earlier jre 1.4.1? Is it still needed or can I remove it safely? And althouth during the installation of java sdk, the installer doesn't insist on installing the jre,still I've to install it on the machine , otherwise there appears problem(I've seen that)....so the question remains unsolved. Why I've to install jre if jdk is already there?

And you didn't answered my 2nd one abt classpath. But anyway thx again. It feelsgreat to have such senior java programmers like you.
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
See if these examples help with classpath. It's just a list of places the compiler or JRE should look to find classes referenced in your code.


A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Sujoy Mukherjee
Ranch Hand

Joined: Dec 31, 2005
Posts: 46

Thx Stan, that's a nice link. Thx for the "Quote" too.
By the way, is it a style or a rule that everybody here give a quote or place some intellectual words as the bottomline of their post(as a signature)?
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
Nah, the tag lines are just fun.
Adam Richards
Ranch Hand

Joined: Nov 03, 2005
Posts: 135
Tip: Try to use more specific subject lines. The more meaningful your subject, the more meaningful your replies.
Layne Lund
Ranch Hand

Joined: Dec 06, 2001
Posts: 3061
1) When you install the JDK the JRE is installed automagically as well. When you install an updated version of the JDK or JRE, it installs the whole thing. This is not a patch like many other software vendors use. If you don't want to use the older version of the JDK or JRE, then you can safely remove it.

2) At this point, you don't need to set the CLASSPATH, unless you have installed other software that uses it. In this case, you need to make sure that the local directory . (DOT) is included in the classpath. I suggest that you remove the CLASSPATH entirely, if possible.

Layne


Java API Documentation
The Java Tutorial
Sujoy Mukherjee
Ranch Hand

Joined: Dec 31, 2005
Posts: 46

Thankz Layne for clearing my doubts abt JRE. Thank you very much.
And dear Mr. bartender, I mean Adam, I'll be cautious in future of my subject lines to be more specific..thank you.
 
jQuery in Action, 2nd edition
 
subject: Two Problems
 
Similar Threads
Where to put jdbc jar files
import in Windows environment
please please need configuration
urgently Help
package problem