How to switch Java environments in RHEL 5 and 6

Solution Verified - Updated -

Issue

  • The system does not display the expected version of Java when the user runs java -version:

    # java -version  
    java version "1.4.2"  
    gij (GNU libgcj) version 4.1.2 20071124 (Red Hat 4.1.2-42)  
    
    Copyright (C) 2006 Free Software Foundation, Inc.  
    This is free software; see the source for copying conditions.  There is NO  
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    
  • How to switch Java Environment in Red Hat Enterprise Linux 5
  • How do I switch the Java environment in RHEL 6?

Environment

  • Red Hat Enterprise Linux 5
  • Red Hat Enterprise Linux 6
  • java

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content