[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 760
  • Last Modified:

Install Java on Ubuntu Linux

I am trying to install Java in Linux Machine (ubuntu).
I have explored almost all the sites available in Google.
http://openjdk.java.net/install/
http://www.mkyong.com/java/how-to-install-java-jdk-on-ubuntu-linux/

It says E: Unable to locate package sun-java6-jdk.
0
MeenuNagpal
Asked:
MeenuNagpal
  • 12
  • 11
  • 2
  • +4
2 Solutions
 
CEHJCommented:
What happens with the following at the command line?
sudo aptitude update
sudo aptitude install sun-java6-jdk

Open in new window

0
 
wesly_chenCommented:
0
 
CEHJCommented:
If that doesn't work, please post the contents of

/etc/apt/sources.list
0
Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

 
CEHJCommented:
You'll probably need the multiverse repo
0
 
underskyCommented:
btw also with first comment, there 2 version of java

sun-java-jdk
and
openjdk

first good, but second faster. point first answer as right ;)
0
 
underskyCommented:
fixed* more right is this one:

sun-java6-jdk sun-java6-jre sun-java6-bin
or
openjdk-6-jdk openjdk-6-bin openjdk-6-jre

btw point first answer as right ;) i just complete they answer.
0
 
MeenuNagpalAuthor Commented:
@CEHJ do you mean sudo apt-get update?
Also cant read the contents of /etc/apt/sources.list? how can i copy the contents?
What is multiverse repo ?
0
 
CEHJCommented:
What version of Ubuntu are you using?
0
 
MeenuNagpalAuthor Commented:
@CEHJ
Following are contents of the Sources.list
# deb cdrom:[Ubuntu 10.10 _Maverick Meerkat_ - Release i386 (20101007)]/ maverick main restricted
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.

deb http://us.archive.ubuntu.com/ubuntu/ maverick main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://us.archive.ubuntu.com/ubuntu/ maverick-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://us.archive.ubuntu.com/ubuntu/ maverick universe
deb http://us.archive.ubuntu.com/ubuntu/ maverick-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://us.archive.ubuntu.com/ubuntu/ maverick multiverse
deb http://us.archive.ubuntu.com/ubuntu/ maverick-updates multiverse

## Uncomment the following two lines to add software from the 'backports'
## repository.
## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
# deb http://us.archive.ubuntu.com/ubuntu/ maverick-backports main restricted universe multiverse
# deb-src http://us.archive.ubuntu.com/ubuntu/ maverick-backports main restricted universe multiverse

## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
deb http://archive.canonical.com/ubuntu maverick partner
deb-src http://archive.canonical.com/ubuntu maverick partner

## This software is not part of Ubuntu, but is offered by third-party
## developers who want to ship their latest software.
deb http://extras.ubuntu.com/ubuntu maverick main
deb-src http://extras.ubuntu.com/ubuntu maverick main

deb http://security.ubuntu.com/ubuntu maverick-security main restricted
deb http://security.ubuntu.com/ubuntu maverick-security universe
deb http://security.ubuntu.com/ubuntu maverick-security multiverse
0
 
MeenuNagpalAuthor Commented:
Ubuntu 10.10
0
 
MeenuNagpalAuthor Commented:
1. not able to update the sources.list
2. sudo add-apt-repository ppa:sun-java-community-team/sun-java6  gives following error
Error reading https://launchpad.net/api/1.0/~sun-java-community-team/+archive/sun-java6: <urlopen error [Errno -2] Name or service not known>

0
 
MeenuNagpalAuthor Commented:
Tried with Unbuntu Software Center but it gives following Exception


W:Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/maverick/Release.gpg  Something wicked happened resolving 'us.archive.ubuntu.com:http' (-5 - No address associated with hostname)
, W:Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/maverick/main/i18n/Translation-en.bz2  Something wicked happened resolving 'us.archive.ubuntu.com:http' (-5 - No address associated with hostname)
,
java.JPG
0
 
for_yanCommented:


There are several links for instalation of Java on Ubuntu in this
trail. Question was not yeat resolved but links seem to be reasonable:
http://www.experts-exchange.com/OS/Linux/Q_26983400.html
0
 
objectsCommented:
your sources list looks ok (it needs http://archive.canonical.com/ubuntu maverick partner)

> W:Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/maverick/Release.gpg  Something wicked happened resolving 'us.archive.ubuntu.com:http' (-5 - No address associated with hostname)
> , W:Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/maverick/main/i18n/Translation-en.bz2  Something wicked happened resolving 'us.archive.ubuntu.com:http' (-5 - No address associated with hostname)

that doesn't look good though, check your network setup
0
 
MeenuNagpalAuthor Commented:
I am able to access the link from Firefox but I guess there is some issue with proxy settings. Firefox ask me for login password for proxy login.
Is there any way I can change the settings
0
 
CEHJCommented:
It's not really to do with Firefox, but with your package manager(s). Are you able to install *any* packages?
0
 
MeenuNagpalAuthor Commented:
How to execute Acquire::http::Proxy "http://user:pwd@proxy:port";
it says
Acquire::http::Proxy: command not found
0
 
CEHJCommented:
That's a line in the /etc/apt/apt.conf file.
0
 
MeenuNagpalAuthor Commented:
Sorry I realised the mistake. But there is no file named apt.conf in /etc/apt folder
Following is the list of files I have in the older
root root 4096 2011-05-04 16:32 apt.conf.d
root root 4096 2010-10-05 10:09 preferences.d
root root    0 2010-10-07 11:58 secring.gpg
root root 2609 2011-05-05 11:21 sources.list
root root 4096 2011-05-04 17:30 sources.list.d
root root 2609 2011-05-05 11:21 sources.list.save
root root 1200 2010-10-07 11:58 trustdb.gpg
root root 7304 2010-10-07 12:14 trusted.gpg
root root 6713 2010-10-07 11:58 trusted.gpg~
root root 4096 2010-10-05 10:09 trusted.gpg.d
0
 
CEHJCommented:
See

man apt.conf

You could also (temporarily try)

export http_proxy=http://user:pass@host:port

immediately prior to running apt-get
0
 
MeenuNagpalAuthor Commented:
0
 
CEHJCommented:
Plenty of help given, including instructions to use the partner repo at http:#35694276
0
 
MeenuNagpalAuthor Commented:
When did I say that I didnt get any help ?
0
 
MeenuNagpalAuthor Commented:
Thanks a ton CEHJ. I really appriciate your help and instant response to all the queries.
0
 
CEHJCommented:
:)
0
 
modus_operandiCommented:
MeenuNagpal,
 
I have reopened your question and started the process of closing it with a split amongst two or more Experts, as that outcome seems more equitable than your original disposition.
 
modus_operandi
EE Admin
0
 
CEHJCommented:
:)
0

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

  • 12
  • 11
  • 2
  • +4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now