LinuxQuestions.org
Help answer threads with 0 replies.
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-28-2010, 08:09 AM   #1
wch705
LQ Newbie
 
Registered: Jul 2010
Location: Australia
Distribution: Debian
Posts: 23

Rep: Reputation: 0
Debian: how to install java and get it works


i followed the instructions on http://www.oracle.com/technetwork/ja...ng-138783.html and now it was installed at /usr/java/jdk1.6.0_20
When I tried to use javac to compile, it said "javac: command not found".
then I added the following code into /etc/profile
Code:
JAVA_HOME="/usr/java/jdk1.6.0_20"
export JAVA_HOME
but it didn't solve the problem.
And finally, i found this http://www.crazysquirrel.com/computing/debian/java.jspx
but when I tried to use
Code:
apt-get -u install java-package
it said
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Couldn't find package java-package

Did i do anything wrong?
Thanks
 
Old 07-28-2010, 08:14 AM   #2
alli_yas
Member
 
Registered: Apr 2010
Location: Johannesburg
Distribution: Fedora 14, RHEL 5.5, CentOS 5.5, Ubuntu 10.04
Posts: 559

Rep: Reputation: 92
In your .bash_profile; you should have your PATH environment variable.

There should also be a line saying export PATH

Just before this line add in:

Code:
PATH=$PATH:$JAVA_HOME/bin
Then logout and login again; and your javac command should work.
 
Old 07-28-2010, 08:14 AM   #3
centosboy
Senior Member
 
Registered: May 2009
Location: london
Distribution: centos5
Posts: 1,137

Rep: Reputation: 116Reputation: 116
Quote:
Originally Posted by wch705 View Post
i followed the instructions on http://www.oracle.com/technetwork/ja...ng-138783.html and now it was installed at /usr/java/jdk1.6.0_20
When I tried to use javac to compile, it said "javac: command not found".
then I added the following code into /etc/profile
Code:
JAVA_HOME="/usr/java/jdk1.6.0_20"
export JAVA_HOME
but it didn't solve the problem.
And finally, i found this http://www.crazysquirrel.com/computing/debian/java.jspx
but when I tried to use
Code:
apt-get -u install java-package
it said
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Couldn't find package java-package

Did i do anything wrong?
Thanks
add to /etc/profile

Code:
export JAVA_HOME="/usr/java/jdk1.6.0_20/bin"

restart or open another shell session or run

Code:
source /etc/profile

Last edited by centosboy; 07-28-2010 at 08:16 AM.
 
Old 07-28-2010, 09:21 AM   #4
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 2,324
Blog Entries: 1

Rep: Reputation: 447Reputation: 447Reputation: 447Reputation: 447Reputation: 447
Use java-package to create a .deb from the .bin you get from java.sun.com. And then install it.

# dpkg -i <package.deb>

BITD suns java (now oracle I guess) required libstdc++5 which was not installed by default. libstdc++6 was installed by default. One quirk I noticed for java applets several moons ago on debian etch.

And make sure all of your paths are properly setup. Otherwise you might have to do things the long way to get things to work. Full paths, copying every dep in your local directory and all sorts of funk that you don't need to do if you set it up properly. Or use something like eclipse to facilitate your assimilation into the collective.
 
Old 07-28-2010, 10:00 AM   #5
the trooper
Senior Member
 
Registered: Jun 2006
Location: England
Distribution: Debian Jessie Amd64
Posts: 1,477

Rep: Reputation: Disabled
The easiest way to do this is enable contrib and non-free in your sources.list.
Then install with:

Code:
aptitude install sun-java6-plugin
This is the required package:

http://packages.debian.org/lenny/sun-java6-plugin

I'm assuming you are using Lenny/Stable?.

Last edited by the trooper; 07-28-2010 at 10:01 AM.
 
Old 07-28-2010, 03:35 PM   #6
craigevil
Senior Member
 
Registered: Apr 2005
Location: OZ
Distribution: Debian Sid
Posts: 4,734
Blog Entries: 12

Rep: Reputation: 461Reputation: 461Reputation: 461Reputation: 461Reputation: 461
the_trooper is correct there is no need to build Java simply use apt-get/aptitude and install it. You haven't had to build Java since Woody.

Java(TM) Plug-in 1.6.0_21
Filename /usr/lib/jvm/java-6-sun-1.6.0.21/jre/lib/i386/libnpjp2.so
Plugin Version:
Plugin Description: The next generation Java plug-in for Mozilla browsers.

See Java/Sun - Debian Wiki - http://wiki.debian.org/Java/Sun

You can also use Openjdk, the browser plugin on stable is icedtea-gcjwebplugin, on testing and sid icedtea6-plugin.
 
  


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 automated install (debian) SabbeRubbish Linux - Software 6 03-08-2010 05:02 AM
Debian Install works great but where is XF86Config file? stanpasquale Linux - Newbie 1 07-03-2009 01:51 AM
PS/2 mouse works sometimes in knoppix debian-like install notapplicable Linux - Hardware 1 10-21-2005 09:45 PM
install java in debian master Debian 10 08-25-2005 03:05 PM
trying to install java on debian ahprophet Linux - Software 1 01-10-2005 02:47 PM


All times are GMT -5. The time now is 01:00 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