PDA

View Full Version : Installazione java su ubuntu


Abdujaparov
29-11-2006, 20:56
Salve a tutti ho scaricato, dal sito della sun, il pacchetto .bin con java jdk 1.5.0.9, l'ho installato senza problemi, ora per fare in modo che javac & company siano attivi se non ricordo male dovrei inserire il path in .bash_profile, se lo metto nel .bash_profile nella mia cartella utente lo vedrei solo io, per farlo vedere da tutti gli utenti quale file devo andare a modificare?
Grazie a tutti, ciao ciao.

DigitalKiller
30-11-2006, 11:54
Salve a tutti ho scaricato, dal sito della sun, il pacchetto .bin con java jdk 1.5.0.9, l'ho installato senza problemi, ora per fare in modo che javac & company siano attivi se non ricordo male dovrei inserire il path in .bash_profile, se lo metto nel .bash_profile nella mia cartella utente lo vedrei solo io, per farlo vedere da tutti gli utenti quale file devo andare a modificare?
Grazie a tutti, ciao ciao.

Devi modificare il file /etc/bash.bashrc :)

Abdujaparov
01-12-2006, 06:23
Ciao, nel file bash.bashrc č cosė composto:

# System-wide .bashrc file for interactive bash(1) shells.

# To enable the settings / commands in this file for login shells as well,
# this file has to be sourced in /etc/profile.

# If not running interactively, don't do anything
[ -z "$PS1" ] && return

# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize

# set variable identifying the chroot you work in (used in the prompt below)
if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then
debian_chroot=$(cat /etc/debian_chroot)
fi

# set a fancy prompt (non-color, overwrite the one in /etc/profile)
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '

# Commented out, don't overwrite xterm -T "title" -n "icontitle" by default.
# If this is an xterm set the title to user@host:dir
#case "$TERM" in
#xterm*|rxvt*)
# PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"'
# ;;
#*)
# ;;
#esac

# enable bash completion in interactive shells
#if [ -f /etc/bash_completion ]; then
# . /etc/bash_completion
#fi

# sudo hint
if [ ! -e $HOME/.sudo_as_admin_successful ]; then
case " $(groups) " in *\ admin\ *)
if [ -x /usr/bin/sudo ]; then
cat <<-EOF
To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.

EOF
fi
esac
fi

# if the command-not-found package is installed, use it
if [ -x /usr/bin/command-not-found ]; then
function command_not_found_handle {
/usr/bin/command-not-found $1
return $?
}
fi


Il percorso:
/home/angelo/download/jdk1.5.0_09/bin
dove lo devo incollare? Non vedo nessuna stringa in c'č PATH.
Grazie, ciao ciao.

DigitalKiller
01-12-2006, 10:52
Ciao, nel file bash.bashrc č cosė composto:

# System-wide .bashrc file for interactive bash(1) shells.

# To enable the settings / commands in this file for login shells as well,
# this file has to be sourced in /etc/profile.

# If not running interactively, don't do anything
[ -z "$PS1" ] && return

# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize

# set variable identifying the chroot you work in (used in the prompt below)
if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then
debian_chroot=$(cat /etc/debian_chroot)
fi

# set a fancy prompt (non-color, overwrite the one in /etc/profile)
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '

# Commented out, don't overwrite xterm -T "title" -n "icontitle" by default.
# If this is an xterm set the title to user@host:dir
#case "$TERM" in
#xterm*|rxvt*)
# PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"'
# ;;
#*)
# ;;
#esac

# enable bash completion in interactive shells
#if [ -f /etc/bash_completion ]; then
# . /etc/bash_completion
#fi

# sudo hint
if [ ! -e $HOME/.sudo_as_admin_successful ]; then
case " $(groups) " in *\ admin\ *)
if [ -x /usr/bin/sudo ]; then
cat <<-EOF
To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.

EOF
fi
esac
fi

# if the command-not-found package is installed, use it
if [ -x /usr/bin/command-not-found ]; then
function command_not_found_handle {
/usr/bin/command-not-found $1
return $?
}
fi


Il percorso:
/home/angelo/download/jdk1.5.0_09/bin
dove lo devo incollare? Non vedo nessuna stringa in c'č PATH.
Grazie, ciao ciao.

Prova ad inserire questa stringa, poi se non sbaglio devi o riavviare il sistema o uscire dalla sessione e rientrare:

CLASSPATH=".;/home/angelo/download/jdk1.5.0_09/bin"
export CLASSPATH

Abdujaparov
02-12-2006, 08:04
Ho inserito:

CLASSPATH=".;/home/angelo/download/jdk1.5.0_09/bin"
export CLASSPATH

In coda al file ma non succede nulla, ho riavviato non semplicemente terminato la sessione ma niente. Cosa provo a fare?
Grazie, ciao ciao.

-Slash
02-12-2006, 08:05
ma fare un sudo update-alternatives --config java e selezionare la java di sun come predefinita no? ;)

Scoperchiatore
03-12-2006, 21:26
ma fare un sudo update-alternatives --config java e selezionare la java di sun come predefinita no? ;)

esatto. Ogni distribuzione ha un pacchettino per configurare java, dato che sono problemi comuni ;)

Altrimenti, le variabili da impostare sono
PATH
JAVA_HOME

e non CLASSPATH, che contiene un path per le classi che si vuole rendere visibili all'avvio dei programmi java.

Abdujaparov
08-12-2006, 21:22
Ciao a tutti allora, ho modificato il file /etc/bash.bashrc inserendo path invece che classpath ma non cambia nulla.

Ho modificato il file .bash_profile nella mia directory utente in questo modo:

# ~/.bash_profile: executed by bash(1) for login shells.
# see /usr/share/doc/bash/examples/startup-files for examples.
# the files are located in the bash-doc package.

# the default umask is set in /etc/login.defs
#umask 022

# include .bashrc if it exists
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi

# set PATH so it includes user's private bin if it exists
if [ -d ~/bin ] ; then
PATH=~/bin:/home/angelo/download/jdk1.5.0_09/bin:"${PATH}"
fi


ma niente.

Se do sudo update-alternatives --config java, ottengo:

There is only 1 program which provides java
(/usr/bin/gij-wrapper-4.1). Nothing to configure.

Come diamine faccio ad installare java?
Grazie, ciao ciao.