zippo_qq 发表于 2005-3-7 23:01:22

Java问题因为想快点解决所以放在这里了..

如果给坛主带来不便,先sorry

我已经设置好环境变量可还是提示如下

# javac HelloWorld.java
libgcj-javac-placeholder.sh

This script is a placeholder for the /usr/bin/javac
master link required by jpackage.org conventions.libgcj's
rmiregistry, rmic and jar tools are now slave symlinks to these
masters, and are managed by the alternatives(8) system.

This change was necessary because the rmiregistry, rmic and jar tools
installed by previous versions of libgcj conflicted with symlinks
installed by jpackage.org JVM packages.

jc1: out of memory allocating 1342179073 bytes after a total of 135168 bytes
# java HelloWorld
libgcj-java-placeholder.sh

This script is a placeholder for the /usr/bin/java
master link required by jpackage.org conventions.libgcj's
rmiregistry, rmic and jar tools are now slave symlinks to these
masters, and are managed by the alternatives(8) system.

This change was necessary because the rmiregistry, rmic and jar tools
installed by previous versions of libgcj conflicted with symlinks
installed by jpackage.org JVM packages.
Exception in thread "main" java.lang.NoClassDefFoundError: HelloWorld
   at gnu.gcj.runtime.FirstThread.run() (/usr/lib/libgcj.so.5.0.0)
   at _Jv_ThreadRun(java.lang.Thread) (/usr/lib/libgcj.so.5.0.0)
   at _Jv_RunMain(java.lang.Class, byte const, int, byte const, boolean) (/usr/l ib/libgcj.so.5.0.0)
   at __libc_start_main (/lib/tls/libc-2.3.3.so)
有点弄不明白第一次在Linux下用..所以想请教..可看了精华贴子么找到解决方法..所以向大家询问下

月下刀客 发表于 2005-3-8 08:42:05

你安装的j2sdk吧,安装在哪个目录?环境变量如何设置的,贴出来大家学习学习 :twisted: 。

zippo_qq 发表于 2005-3-8 15:14:30

安装在/usr/java/j2sdk1.5.0_01
在/etc/profile文件中添加以下内容
JAVA_HOME=/usr/java/j2sdk1.5.0_01
PATH=$PATH:.:$JAVA_HOME/bin
CLASSPATH=$JAVA_HOME/lib/tools.jar:.:$JAVA_HOME/lib/dt.jar
export JAVA_HOME
export PATH
export CLASSPATH

可还是有问题啊...不知道怎么解决以上问题

月下刀客 发表于 2005-3-8 15:34:27

http://www.linuxfans.org/nuke/modules.php?name=Forums&file=viewtopic&t=105367&highlight=j2sdk

zippo_qq 发表于 2005-3-8 16:04:39

以解决西西
页: [1]
查看完整版本: Java问题因为想快点解决所以放在这里了..