Issue with JDK/JRE Environment Setup

G

genesis456

I installed the jdk and jre here:

C:\Java\jdk1.6.0_24\bin
and
C:\Java\jre6

currently my environment variables are as follows:

System Variables,
PATH=C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:
\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;C:
\Perl64\site\bin;C:\Perl64\bin;C:\Ruby\bin;%SystemRoot%
\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Program Files
(x86)\MySQL\MySQL Server 5.0\bin;%SYSTEMROOT%
\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Common Files
\Teleca Shared;C:\PROGRA~2\IBM\CLIENT~1\Shared;C:\Program Files
(x86)\Common Files\Adobe\AGL;C:\PROGRA~2\IBM\CLIENT~1;C:\PROGRA~2\IBM
\CLIENT~1\Emulator;C:\Program Files (x86)\QuickTime\QTSystem\;C:
\strawberry\c\bin;C:\strawberry\perl\site\bin;C:\strawberry\perl\bin;C:
\Program Files (x86)\Windows Live\Shared;C:\Java\1.6.0_24\bin

and

CLASSPATH=.;C:\Program Files (x86)\Java\jre6\lib\ext\QTJava.zip

any ideas what is going on????

I get the following when I run these two commands:

c:\dev\java>javac HelloWorldApp.java
'javac' is not recognized as an internal or external command,
operable program or batch file.

c:\dev\java>java -version
java version "1.6.0_23"
Java(TM) SE Runtime Environment (build 1.6.0_23-b05)
Java HotSpot(TM) Client VM (build 19.0-b09, mixed mode, sharing)

also

i think i have the jre installed twice, the one i installed today is:
C:\Java\jre6


the original jre was here: C:\Program Files (x86)\Java\jre6\lib\ext
\QTJava.zip

not sure if that is an issue. I am all ears though...
 
G

grobs456

I installed the jdk and jre here:

C:\Java\jdk1.6.0_24\bin
and
C:\Java\jre6

currently my environment variables are as follows:

System Variables,
PATH=C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:
\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;C:
\Perl64\site\bin;C:\Perl64\bin;C:\Ruby\bin;%SystemRoot%
\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Program Files
(x86)\MySQL\MySQL Server 5.0\bin;%SYSTEMROOT%
\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Common Files
\Teleca Shared;C:\PROGRA~2\IBM\CLIENT~1\Shared;C:\Program Files
(x86)\Common Files\Adobe\AGL;C:\PROGRA~2\IBM\CLIENT~1;C:\PROGRA~2\IBM
\CLIENT~1\Emulator;C:\Program Files (x86)\QuickTime\QTSystem\;C:
\strawberry\c\bin;C:\strawberry\perl\site\bin;C:\strawberry\perl\bin;C:
\Program Files (x86)\Windows Live\Shared;C:\Java\jdk1.6.0_24\bin

Changed C:\Java\1.6.0_24\bin to C:\Java\jdk1.6.0_24\bin

BUT still am faced with the same issue when using javac from the
command line.
 
R

Roedy Green

Note you need to add the JRE bin as well.

The JDK by default will install two JREs as well.

You mainly need to install a separate JRE when you are using a 64-bit
JDK and want a 32-bit JRE as well.
--
Roedy Green Canadian Mind Products
http://mindprod.com
Refactor early. If you procrastinate, you will have
even more code to adjust based on the faulty design.
..
 
G

grobs456

The JDK by default will install two JREs as well.

You mainly need to install a separate JRE when you are using a 64-bit
JDK and want a 32-bit JRE as well.
--
Roedy Green Canadian Mind Productshttp://mindprod.com
Refactor early. If you procrastinate, you will have
even more code to adjust based on the faulty design.
.
I definitely installed the 64 bit version of the JDK. The JRE that was
installed with the 64 bit JDK should also be 64 bit right? I installed
them both in C:\Java, which I realize is not the default. Maybe I
could remove the JRE from Program Files.

I don't care if my JRE is 32 or 64 bit. I just want to compile some
Java code. I seem to have gotten this process mucked up as I haven't
done this in awhile. :/
 
G

grobs456

Wayne,
I appreciate the info. Seems logical and straightforward. I will
follow your logic and see what happens. Thanks for sharing!
 
L

Luuk

I definitely installed the 64 bit version of the JDK. The JRE that was
installed with the 64 bit JDK should also be 64 bit right? I installed
them both in C:\Java, which I realize is not the default. Maybe I
could remove the JRE from Program Files.

Dont remove them, but try to uninstall them....
 
L

Lew

Wayne,
I appreciate the info. Seems logical and straightforward. I will
follow your logic and see what happens. Thanks for sharing!

You don't need, nor should you have, more than one JRE bin in your PATH.
 
G

grobs456

The JDK/bin contains various tools such as javac.exe, while the
public JRE/bin contains the current JRE tools.  The private JRE installed
as part of the JDK is not updated when you update the public JRE.

Apparently the reason for two JREs (one public, one part of the JDK) is
that the JDK tools are written in Java and require a stable JRE to run.
But usually developers want to use the latest JRE for their code, so
using the private JRE instead is not a good idea (except to run JDK tools).
And since some tools (java.exe) are in both locations, you want to
make sure the public JRE is listed first on the PATH.

So right now I don't have a public JRE if I'm not mistaken. I removed
all traces of it. My assumption is that I will end up installing it if
I were to install QuickTime, or visit certain pages, and if I install
it in that manner it will modify my PATH variables. Is that correct?

Thanks for the info. That makes sense. So is there anything else you
would do if you were in my shoes?
 
A

Arne Vajhøj

Since one normally updates the public JRE and the JDK in tandem, this is
a difference that makes no difference.

The actual logic is that the public JRE is for people who don't want a
JDK. If you do want a JDK, you don't even need the so-called "public"
JRE because you get the *exact same thing* in the "jre/" subdirectory of
the JDK.

You don't need it, but you still get it.

Arne
 
L

Lew

Wayne said:
That message means the directory containing javac.exe is not listed
on the PATH setting. I suspect you didn't install the JDK where
you think you did:

C:\Java\jdk1.6.0_24\bin

is not the default location. Go there in Windows Explorer and
see if that is correct. If not, try looking in the default location:

C:\Program Files (x86)\Java\jdk1.6.0_24\bin

Note you need to add the JRE bin as well. Also you may want to download
the new version of JavaDB, 10.6.2.1, which you can download from
the Apache.org site or from
<http://download.java.net/maven/glassfish/javadb/javadb/10.6.2.1/>. You
can also download an even more current version from derby.apache.org.

Wow.

Now why would you go and misinform people like that?

You do not "need to add the JRE bin as well". That's completely bogus.

Derby is already included in the JDK download. Why do you advise him to
download it again, separately? He's already got it.
 
L

Lew

Wayne said:
The JDK/bin contains various tools such as javac.exe, while the
public JRE/bin contains the current JRE tools. The private JRE installed
as part of the JDK is not updated when you update the public JRE.

Depends on how you do your update. I got big news for you - what you are
pleased to call the "private" JRE is identical to what you call the "public"
JRE. The tools in the JDK bin/ are a superset of those in the JRE bin/, not a
disjoint set.

Get your facts straight.
Apparently the reason for two JREs (one public, one part of the JDK) is
that the JDK tools are written in Java and require a stable JRE to run.
But usually developers want to use the latest JRE for their code, so
using the private JRE instead is not a good idea (except to run JDK tools).
And since some tools (java.exe) are in both locations, you want to
make sure the public JRE is listed first on the PATH.

Nonsense. I don't know where you get those ideas, but they're not valid. In
fact, they're a pack of lies.

For example (using the only Java for which I have both versions handy):

$ find jdk1.6.0_22 jre1.6.0_22 -name java
jdk1.6.0_22/db/demo/programs/scores/java
jdk1.6.0_22/db/demo/programs/vtis/java
jdk1.6.0_22/bin/java
jdk1.6.0_22/jre/bin/java
jre1.6.0_22/bin/java

$ diff jdk1.6.0_22/bin/java jdk1.6.0_22/jre/bin/java

$ diff jdk1.6.0_22/bin/java jre1.6.0_22/bin/java

$

Please stop spreading such weird and fallacious notions.
 
L

Lew

Wayne said:
The two JREs are identical right after you've updated the JDK. But
if later the JRE alone is updated, only one of the two JREs get updated,
the "public" one. So if you have automatic updates set in the Java
control panel, then over time the two JREs would be different versions.

Like I said, that depends on how you update. Why would someone working with a
JDK set their JRE to auto-update and then be so careless as to let it fall out
of synch, even assuming such a one installed both?
Running the 6u22 JDK tools, compiled against a 6u22 JRE, may not be
safe to run on a 6u24 JRE. The "private" JRE is only used by the JDK tools,

More bullshit.
the latest "public" JRE by your applications. If you are running the 6u22 javac

Unless you establish the JDK as your "public" JRE.
with a 6u24 JRE, or vice-versa, the results will probably work fine, but
there is no reason to take such a chance. (E.g., what if some static final int
changed values in some standard library?)

Really, that is nonsense. There are only bug fixes between _xx versions. If
you run the 6u22 and 6u24 versions of javac, the only difference will be that
the former will have a bug the latter does not. Either will work fine with
*any* previous version of Java, save for bugs in those previous versions.
Either will work fine with each other's JVM, save for the aforementioned bugs.
That's the fact, contrary to what you said.
Lew, you're one of the smartest contributors to this group, but you can
be quite rude in your posts. Please don't assume statements are
a pack of lies, weird and fallacious, or whatever, just because you don't

I didn't "assume". The things you claimed actually were a pack of lies, weird
and fallacious.

Don't spread false information then act aggrieved when you're called on it.

It's not "rude" to tell the truth. What you did is what's rude, namely tell
lies then get upset when that was objectively mentioned.
agree. If I'm wrong (which happens often!) I'd appreciate it if you could
tell me so politely, or not at all. In this case, I think you forgot that
the public JRE can be updated independently (and in some cases automatically)

Only if you choose that, which does not obviate your responsibility to ensure
coordination of that with other versions where you care.
from the private JRE used by the JDK tools. But if I'm wrong, please explain
the real reason why the JDK installs a separate copy of the JRE (along with
the public JRE).

You shouldn't assume I forgot anything, particularly when I addressed it in
the post to which you're responding.

What's rude is to post false information then act all insulted when it's
pointed out that your statements are wrong. Which they were. No "assumption"
there - your statements contradicted fact. Then when challenging you play the
"rude" card instead of correcting your bad information. That is bad behavior.

Why should I coddle your feelings when you are spreading disinformation? I am
much more concerned with the feelings of those who follow your mistaken advice.

As you should be. Get your ego out of the way.
 
L

Lew

Elsewhere in this thread Lew noted that he doesn't like having the public
JRE/bin and the private JRE/bin in the PATH. But as has been pointed out

Not true. What I said was that it isn't necessary. I never said anything
about "like" or "don't like".
elsewhere, I believe you are wrong on this issue. It's probably safe

No. It is true that you don't need, nor should you have, more than one JRE on
the PATH. It's useless - you'll only get the first one from the PATH, so why
have two?
most of the time to use the one JRE as Lew prefers, but I don't see the

It's definitely safe *all* the time.

Stop making stuff up.
harm in playing safe and using the current public JRE (which is what your
clients will likely have installed) for your .class files, your applets,

What your clients may have installed is *a* JRE - you have no way to know
which one.

It is also true, and I notice that you don't bother to pretend this is wrong,
that the JREs are identical in the two distributions.
and testing your code, and using the private JRE only to run the JDK
development tools. Which is why the JDK tools ship with their own JRE
in the first place.

No, they ship with the JDK in the first place so you won't need to download
the JRE separately if you're a developer.

I never spoke against having more than one JRE or JDK. I have several myself,
though as noted above I don't always download the JRE separately, seeing as
how it comes with the JDK anyway. Twice over.

What I spoke against was having more than one in the PATH, for the objective
reason that it does no good.
 
D

Daniele Futtorovic

Lew, you're one of the smartest contributors to this group, but you can
be quite rude in your posts. Please don't assume statements are
a pack of lies, weird and fallacious, or whatever, just because you don't
agree. If I'm wrong (which happens often!) I'd appreciate it if you could
tell me so politely, or not at all.

A very reasonable and pertinent request, methinks.
 
L

Lew

A very reasonable and pertinent request, methinks.

No, not when Wayne perpetrated such misinformation.

He should correct what he tells people instead of switching to an /ad hominem/
approach. Funny how people call other people "rude" when they don't want to
admit that they were wrong, instead of either proving that they were right
(which he wasn't) or changing their behavior.
 
L

Lew

No, not when Wayne perpetrated such misinformation.

He should correct what he tells people instead of switching to an /ad hominem/
approach. Funny how people call other people "rude" when they don't want to
admit that they were wrong, instead of either proving that they were right
(which he wasn't) or changing their behavior.

Furthermore, if being "polite" had worked, Wayne would not have repeated his
misinformation four days after I *did* "politely" correct him. He completely
ignored that feedback and continued to lie. Then when called on it he calls
me "rude". Why did he not even respond to the polite post, then days later
complain about rudeness rather than to the (very same) facts? Why did he not
correct his fallacies? Isn't it much ruder to continue to lie and to ignore
the feedback?
 
D

Daniele Futtorovic

Furthermore, if being "polite" had worked, Wayne would not have repeated
his misinformation four days after I *did* "politely" correct him. He
completely ignored that feedback and continued to lie. Then when called
on it he calls me "rude". Why did he not even respond to the polite
post, then days later complain about rudeness rather than to the (very
same) facts? Why did he not correct his fallacies? Isn't it much ruder
to continue to lie and to ignore the feedback?

I disagree. I do think you have been rude. And while I find it perfectly
acceptable at times to be rude, I think it was unjustified in this context.
You don't need, nor should you have, more than one JRE bin in your
PATH.

That is polite, but it's hardly a correction. Unless you demand that
people take your word for everything.

After that you posted a more elaborate reply where you corrected (in my
opinion accurately) his mistakes.

There are no replies or spreading misinformation from Wayne after that
-- of the two of you, the next one to post were *you*, in what I found a
very rude manner, even if the facts were correct. And the post you were
replying to was Wayne's post four days before, the _same one_ grobs456
replied to, a reply which gave rise to your elaboration mentioned above.
So you've been rebuking him politely and indirectly one time, and then
rudely so a second time a few days later. Without any intermittent post
from him.

To the latter he replied with what you call an /ad hominem/, in my
opinion unjustifiedly so. I do not consider that an /ad hominem/,
inasmuch as it wasn't an attack on you, but rather a request to you, and
one I find reasonable.

My opinion.
 
A

Arne Vajhøj

Furthermore, if being "polite" had worked, Wayne would not have repeated
his misinformation four days after I *did* "politely" correct him. He
completely ignored that feedback and continued to lie. Then when called
on it he calls me "rude". Why did he not even respond to the polite
post, then days later complain about rudeness rather than to the (very
same) facts? Why did he not correct his fallacies? Isn't it much ruder
to continue to lie and to ignore the feedback?

Well - also in this case: if you used "spreading incorrect information"
instead of "lie" then the point may get better through.

I have no reason to believe that Wayne deliberately want to
mislead people, troll or in any other way did it with a purpose.

Arne
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,968
Messages
2,570,154
Members
46,702
Latest member
LukasConde

Latest Threads

Top