*
The moose likes Java in General and the fly likes There are two jre7 folders -- one in Program Files, one in Program Files (x86) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "There are two jre7 folders -- one in Program Files, one in Program Files (x86)" Watch "There are two jre7 folders -- one in Program Files, one in Program Files (x86)" New topic
Author

There are two jre7 folders -- one in Program Files, one in Program Files (x86)

Griff Haldeman
Greenhorn

Joined: Jul 01, 2011
Posts: 5
I have two jre7 folders. Can I delete one of them?

Here are the folders of interest:

C:\Program Files\Java\jre7 <-- This appeared when I downloaded jdk1.7.0_03
C:\Program Files\Java\jdk1.7.0_03

C:\Program Files (x86)\Java\jre7 <-- This appeared when I downloaded Java runtime environment so my computer can use Java

Can I delete the C:\Program Files\Java\jre7 folder without any consequence, because it appears to be the same thing as the other jre7 folder in Program Files (x86)? Just trying to de-clutter my computer. Thanks in advance.
Martin Vajsar
Sheriff

Joined: Aug 22, 2010
Posts: 3606
    
  60

The "Program Files" folder contain 64-bit version of the JRE, and "Program Files (x86)" contains the 32-bit version. If you really don't need one of them, don't just delete the folder. Use proper Control Panel (Programs and Features, formely Add/Remove programs) to correctly uninstall it.
Griff Haldeman
Greenhorn

Joined: Jul 01, 2011
Posts: 5
Thanks. Also, are all files in the Program Files (x86) for 32-bit operating systems, and all in Program Files for 64-bit? And if I am running a 64-bit operating system, will I ever need the 32-bit version at some point?
Martin Vajsar
Sheriff

Joined: Aug 22, 2010
Posts: 3606
    
  60

There is no guarantee that a 32-bit application won't get installed into Program Files, or 64-bit into Program Files (x86). Firstly, users can override that manually with most installers, and secondly, some applications/installers are not coded according to MS specs and may get installed in the wrong place (most often the Program Files path is hardcoded, so a 32-bit app ends there, I don't think 64-bit app would end in (x86) folder by a simple mistake like this).

This separation is hardly useful IMO, it just allows you to have a 32-bit and 64-bit app installed into identically named folders (such as jre7) regardless of their architecture.

Only you can know whether you need a 32-bit and 64-bit version of the same application. Sometimes a functionality is not available in 32-bit or 64-bit version (eg. if an application uses a plugin which is a 32-bit DLL, it cannot be used with 64-bit application, and vice versa).

Speaking of Java, the situation is more complicated:

Firstly, if you have a Java application that calls native code and does not provide a DLL for both versions, you need to use the corresponding JRE. Period.

Secondly, although 64-bit JVM allows you to use much more memory, it comes at a price. A reference (pointer) takes 4 bytes in 32-bit JVM , but 8 bytes in 64-bit JVM. Since Java applications use so many references in general (everything is an object, right?), going 64-bit increases memory requirements significantly, by some 50%. Java actually mitigates this and uses compressed pointers when possible; compressed pointers take only 4 bytes, but need some decoding when actually using them, so there is a slight performance penalty instead of the memory overhead. See this article on HotSpot Performance Enhancements.
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14074
    
  16

Most web browsers, notably Microsoft Internet Explorer, are still 32-bit, even if you are running a 64-bit version of Windows. To be able to use Java applets on websites in your 32-bit browser, you'll need to have the 32-bit version of Java installed.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: There are two jre7 folders -- one in Program Files, one in Program Files (x86)
 
Similar Threads
I can't start tomcat service
Need help with my first JDBC program
"cannot resolve symbol" error when compiling...
Head First BeerSelect problems
new to programming, sadly already snagged before i can start