LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-07-2011, 01:33 PM   #1
LawlessBaron
LQ Newbie
 
Registered: Jul 2011
Posts: 9

Rep: Reputation: Disabled
java: command not found Debian


Ok i went to do
Code:
java -version
but it didnt work i installed it and everything i go to
Code:
cd /usr/java
but it doesnt exist
i am running Debian 6 x64

can someone please help me install java i am trying to run a mc server but i need help with java please help me
 
Old 07-07-2011, 02:02 PM   #2
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,808

Rep: Reputation: 604Reputation: 604Reputation: 604Reputation: 604Reputation: 604Reputation: 604
Quote:
i installed it and everything
How did you install it? What did you install?

Anyway:

http://www.google.com/search?client=...hannel=suggest

http://wiki.debian.org/Java/Sun
Running the following should just work:
Code:
apt-get install sun-java6-jdk
 
Old 07-07-2011, 02:05 PM   #3
LawlessBaron
LQ Newbie
 
Registered: Jul 2011
Posts: 9

Original Poster
Rep: Reputation: Disabled
when i try to install i get this

Code:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package sun-java6-jdk is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package sun-java6-jdk has no installation candidate
 
Old 07-07-2011, 02:17 PM   #4
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2016, Slack14.1 Deb Jessie, + 50+ other Linux OS, for test only.
Posts: 16,276

Rep: Reputation: 3153Reputation: 3153Reputation: 3153Reputation: 3153Reputation: 3153Reputation: 3153Reputation: 3153Reputation: 3153Reputation: 3153Reputation: 3153Reputation: 3153
I guess, you are missing the 'non-free' entry in /etc/apt/sources.list

sun-java6-jdk is available http://packages.debian.org/squeeze/sun-java6-jdk
http://packages.debian.org/search?ke...=sun-java6-jdk

.. Can also be added in Synaptic > Settings > Archives : non-free
 
Old 07-07-2011, 02:24 PM   #5
LawlessBaron
LQ Newbie
 
Registered: Jul 2011
Posts: 9

Original Poster
Rep: Reputation: Disabled
i only have ssh access how can i add it to the resources list ?
 
Old 07-07-2011, 02:50 PM   #6
LawlessBaron
LQ Newbie
 
Registered: Jul 2011
Posts: 9

Original Poster
Rep: Reputation: Disabled
Ok i added the link to sources.list after that should i do
Code:
apt-get update
and if so should
Code:
java -version
work for me ?
 
Old 07-07-2011, 02:59 PM   #7
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2016, Slack14.1 Deb Jessie, + 50+ other Linux OS, for test only.
Posts: 16,276

Rep: Reputation: 3153Reputation: 3153Reputation: 3153Reputation: 3153Reputation: 3153Reputation: 3153Reputation: 3153Reputation: 3153Reputation: 3153Reputation: 3153Reputation: 3153
After # apt-get install sun-java6-jdk :

You can see if 'java -version' replies "java version "1.6.0_2x" etc.

If any doubt :
# update-alternatives --config java
... and then select the "sun java".

.
 
Old 07-07-2011, 02:59 PM   #8
LawlessBaron
LQ Newbie
 
Registered: Jul 2011
Posts: 9

Original Poster
Rep: Reputation: Disabled
i do
Code:
apt-get install sun-java6-jdk
and at the end i get this

Code:
update-alternatives: error: cannot stat /opt/java/64/jre-6u26-linux-x64.bin/bin/java: Not a directory
dpkg: error processing openjdk-6-jre-headless (--configure):
 subprocess installed post-installation script returned error exit status 2
dpkg: dependency problems prevent configuration of default-jre-headless:
 default-jre-headless depends on openjdk-6-jre-headless (>= 6b14); however:
  Package openjdk-6-jre-headless is not configured yet.
dpkg: error processing default-jre-headless (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of openjdk-6-jre:
 openjdk-6-jre depends on openjdk-6-jre-headless (>= 6b18-1.8.7-2~squeeze1); however:
  Package openjdk-6-jre-headless is not configured yet.
dpkg: error processing openjdk-6-jre (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of default-jre:
 default-jre depends on default-jre-headless (= 1:1.6-40); however:
  Package default-jre-headless is not configured yet.
 default-jre depends on openjdk-6-jre (>= 6b14); however:
  Package openjdk-6-jre is not configured yet.
dpkg: error processing default-jre (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of openjdk-6-jdk:
 openjdk-6-jdk depends on openjdk-6-jre (>= 6b18-1.8.7-2~squeeze1); however:
  Package openjdk-6-jre is not configured yet.
dpkg: error processing openjdk-6-jdk (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of default-jdk:
 default-jdk depends on default-jre (= 1:1.6-40); however:
  Package default-jre is not configured yet.
 default-jdk depends on openjdk-6-jdk (>= 6b14); however:
  Package openjdk-6-jdk is not configured yet.
dpkg: error processing default-jdk (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of icedtea-6-jre-cacao:
 icedtea-6-jre-cacao depends on openjdk-6-jre-headless (= 6b18-1.8.7-2~squeeze1); however:
  Package openjdk-6-jre-headless is not configured yet.
dpkg: error processing icedtea-6-jre-cacao (--configure):
 dependency problems - leaving unconfigured
Setting up libltdl7 (2.2.6b-2) ...
Setting up libavahi-core7 (0.6.27-2+squeeze1) ...
Setting up libdaemon0 (0.14-2) ...
Setting up avahi-daemon (0.6.27-2+squeeze1) ...
Reloading system message bus config...done.
Starting Avahi mDNS/DNS-SD Daemon: avahi-daemon.
Setting up gsfonts (1:8.11+urwcyr1.0.7~pre44-4.2) ...
Setting up gsfonts-x11 (0.21) ...
Setting up libnss-mdns (0.10-3.1) ...
First installation detected...
Checking NSS setup...
Setting up odbcinst (2.2.14p2-1) ...
Setting up odbcinst1debian2 (2.2.14p2-1) ...
Setting up unixodbc (2.2.14p2-1) ...
Setting up sun-java6-bin (6.26-0squeeze1) ...
update-alternatives: error: cannot stat /opt/java/64/jre-6u26-linux-x64.bin/bin/java: Not a directory
dpkg: error processing sun-java6-bin (--configure):
 subprocess installed post-installation script returned error exit status 2
dpkg: dependency problems prevent configuration of sun-java6-jre:
 sun-java6-jre depends on sun-java6-bin (>= 6.26-0squeeze1) | ia32-sun-java6-bin (>= 6.26-0squeeze1); however:
  Package sun-java6-bin is not configured yet.
  Package ia32-sun-java6-bin is not installed.
dpkg: error processing sun-java6-jre (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of sun-java6-jdk:
 sun-java6-jdk depends on sun-java6-bin (>= 6.26-0squeeze1); however:
  Package sun-java6-bin is not configured yet.
dpkg: error processing sun-java6-jdk (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 openjdk-6-jre-headless
 default-jre-headless
 openjdk-6-jre
 default-jre
 openjdk-6-jdk
 default-jdk
 icedtea-6-jre-cacao
 sun-java6-bin
 sun-java6-jre
 sun-java6-jdk
E: Sub-process /usr/bin/dpkg returned an error code (1)
 
Old 07-07-2011, 03:38 PM   #9
LawlessBaron
LQ Newbie
 
Registered: Jul 2011
Posts: 9

Original Poster
Rep: Reputation: Disabled
anyone any idea?
 
Old 07-07-2011, 04:11 PM   #10
LawlessBaron
LQ Newbie
 
Registered: Jul 2011
Posts: 9

Original Poster
Rep: Reputation: Disabled
can someone help me resolve this issue please ?
 
Old 07-08-2011, 05:47 PM   #11
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2016, Slack14.1 Deb Jessie, + 50+ other Linux OS, for test only.
Posts: 16,276

Rep: Reputation: 3153Reputation: 3153Reputation: 3153Reputation: 3153Reputation: 3153Reputation: 3153Reputation: 3153Reputation: 3153Reputation: 3153Reputation: 3153Reputation: 3153
Probably : # apt-get -f install && apt-get update
.. to be able to install packages again.

Next : ls -l /etc/alternatives/ | grep opt
And then remove the link / links pointing to the alien java* in /opt/.


Now it should be possible to install : # apt-get install sun-java6-jdk
Hopefully the correct links will be made in /etc/alternatives,
making it possible for # 'update-alternatives --config java'
to select "/ust/lib/jvm/java-6-sun/jre/bin/java".
( Or see, that it has been set already by the install of sun-java6-jdk.)
(( Can be checked with 'java -version' too.))

..
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
java -version, bash: java: command not found kirman Programming 4 03-20-2008 12:13 AM
java command not found???? haora Linux - Newbie 3 03-30-2005 11:27 AM
java:command not found allendefall Linux - Software 1 12-24-2004 02:57 AM
(Debian) bash: java: command not found pjpeter Linux - Newbie 3 09-25-2004 03:59 PM
java: command not found inteliblake Linux - Software 4 10-10-2003 09:56 PM


All times are GMT -5. The time now is 10:31 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration