发新话题
打印

【求助】我的j2sdk安装和配置以后还是不行!!请帮帮我

【求助】我的j2sdk安装和配置以后还是不行!!请帮帮我

我的系统是red hat es 3,kernel 2.4.21-9.EL-i686,装了j2sdk-1_4_0-fcs-linux-i386.rpm,根据

一些帖子我吧/etc/profiel配置如下:

pathmunge () {
        if ! echo $PATH | /bin/egrep -q "(^|$1($|" ; then
          if [ "$2" = "after" ] ; then
              PATH=$PATH1
          else             
              PATH=$1PATH
                fi
        fi}
# Path manipulation
JAVA_HOME=/usr/java/j2sdk
CLASSPATH=/usr/java/j2sdk/lib/tools.jar:/usr/java/j2sdk/lib/dt.jar
PATH=$PATHHOME/bin:/usr/java/j2sdk/bin              (以上3行是根据相关配置帖子写的)
if [ `id -u` = 0 ]; then
        pathmunge /sbin
        pathmunge /usr/sbin
        pathmunge /usr/local/sbin
fi
pathmunge /usr/X11R6/bin after
unset pathmunge
# No core files by default
ulimit -S -c 0 > /dev/null 2>&1
USER="`id -un`"
LOGNAME=$USER
MAIL="/var/spool/mail/$USER"
HOSTNAME=`/bin/hostname`
HISTSIZE=1000
if [ -z "$INPUTRC" -a ! -f "$HOME/.inputrc" ]; then
    INPUTRC=/etc/inputrc
fi
export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE INPUTRC
export JAVA_HOME CLASSPATH
for i in /etc/profile.d/*.sh ; do
    if [ -r "$i" ]; then
            . $i
    fi
done
unset i


配置完毕后
# source /etc/profile
运行另一个小的java语言
屏幕显示如下:
Error:failed /usr/java/j2sdk/jre/lib/i386/client/libjvm.so,because libstdc++-libc6.1-

1.so.2:connot open shared object file:No such file or directory
是这个j2sdk版本不适合我的系统还是我的配置哪里有问题呢?是不是系统少什么文件呢?
谢谢大家能给我指点一下^_^      
现实?希望?where am I? 对不起,我不知道该怎么奔跑,怎么坚强 我只能乞讨,挣扎,折磨,毁灭 也许只是需要一个出口吧,即使是通向结束…… ……等待……

TOP

check these files:
/lib/libc.so.6 (glibc)
/usr/lib/gcc-lib/i686-pc-linux-gnu/3.4.0(your gcc version)/libstdc++.so.5 (gcc's c++)
if they are missing, install them       

TOP

我从网上找了一个libstdc++6-3.4.2-67517cl.i386.rpm,这个可以吗?
安装以后,在你上边指出的路径下还是没有那个文件,我该怎么做?      
现实?希望?where am I? 对不起,我不知道该怎么奔跑,怎么坚强 我只能乞讨,挣扎,折磨,毁灭 也许只是需要一个出口吧,即使是通向结束…… ……等待……

TOP

make sure there rpms are installed, some of them are for development, but they are useful when you install software from source ball

Following file names are from Fedora Core 2. Under Redhat, may be the same.

glibc-2.3.3-27.i686.rpm
glibc-common-2.3.3-27.i386.rpm
glibc-devel-2.3.3-27.i386.rpm
glibc-headers-2.3.3-27.i386.rpm
glibc-utils-2.3.3-27.i386.rpm
cpp-3.3.3-7.i386.rpm
gcc-3.3.3-7.i386.rpm
gcc-c++-3.3.3-7.i386.rpm
libgcc-3.3.3-7.i386.rpm
libstdc++-3.3.3-7.i386.rpm
libstdc++-devel-3.3.3-7.i386.rpm

From your error message, you must install this one "libstdc++-3.3.3-7.i386.rpm" or name like "libstdc++-(version).(arch).rpm".
Try these two:
http://download.fedora.redhat.co ... ++-3.3.2-1.i386.rpm
http://download.fedora.redhat.co ... el-3.3.2-1.i386.rpm

The path I listed in my message is under Gentoo Linux. If you can install software from source, only need two package, glibc and gcc       

TOP

thank you very much!!
无论是否成共都很感谢楼上的兄弟^_^      
现实?希望?where am I? 对不起,我不知道该怎么奔跑,怎么坚强 我只能乞讨,挣扎,折磨,毁灭 也许只是需要一个出口吧,即使是通向结束…… ……等待……

TOP

[root@localhost home]# java hello.class
Exception in thread "main" java.lang.NoClassDefFoundError: hello/class
我的错误信息
请高手指教. 我已经设好了路径之类的
PATH=/usr/kerberos/sbin:/usr/kerberos/bin:/usr/java/j2sdk1.4.2_05/bin:/usr/java/j2sdk1.4.2_05/jre/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/root/bin:.:/opt/rtems-4.6/bin
CLASSPATH=/usr/java/j2sdk1.4.2_05/lib:/usr/java/j2sdk1.4.2_05/jre/lib:.
JAVA_HOME=/usr/java/j2sdk1.4.2_05      
我不知道为什么我看到unix-linux下的字符界面那么兴奋?我在努力研究这个问题!并且使自己天天兴奋:)

TOP

"java -cp . hello", no ".class", "-cp ." is to set CLASSPATH with current directory if hello.class is under it.
Please read some Java book or JDK document, this is too basic.      

TOP

[root@localhost home]# java hello.class
Exception in thread "main" java.lang.NoClassDefFoundError: hello/class
………………………………………………&&&&&&&&&&&&&&&&&&&&&&&&&&¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥


hello.class????????

不是Hello.class吗???

java的类名第一个字母要大写的;  其余    同楼上      

TOP

我看见的PATH是这样设置的:
注意: 大写和小写要区分,j2sdk1.4.2.03的安装路径是在用户的主文件夹下的和1.4.2_02以前的路径是不一样的
export PATH=/usr/java/j2sdk1.4.2_02/binPATH
export NPX_PLGIN_PATH=/usr/java/j2sdk1.4.2_0/jre/plugin/i38
最后输入:java   -version命令进行检验如果成功会看见JDK的版本号:w      

TOP

发新话题