由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Java版 - another question driving me crazy...
相关主题
weird class definitionJBuilder question
一个怪异的java 运行问题新手求助,急急急!!!
问一个 java generic问题如何从java中调用Matlab
ant javac error in eclipse 3.0?java & XML 2 example problem
Re: How to compile a Java program with import my own package in UNIX问个java on linux的奇怪问题
[转载] Anybody tried "gcj"?Question on classpath
入门Java CLASSPATH问题:请问一个最初级问题
为何运行JAVA出现这个错误?Unix: where to execute java program?
相关话题的讨论汇总
话题: cplot话题: classpath话题: exception话题: when话题: so
进入Java版参与讨论
1 (共1页)
q**c
发帖数: 179
1
say I have two packages B and C put as
in the directory /A/B and /A/C. The classpath is set as /A.
so when compiling them, no problem at all.
Now have a test class named Cplot.class in /A/C.
When run it, it gives message:
"Exception in thread "main" java.lang.NoClassDefFoundError: Cplot".
I find since classpath is set as /A, java cannot find this Cplot.
So I add /A/C to the classpath, but it gives message:
"Exception in thread "main" java.lang.NoClassDefFoundError: Cplot (wrong name:
A/C/Cplot).
g*s
发帖数: 2277
2
make Cplot.java as one class in package C
and run "java C.Cplot"

【在 q**c 的大作中提到】
: say I have two packages B and C put as
: in the directory /A/B and /A/C. The classpath is set as /A.
: so when compiling them, no problem at all.
: Now have a test class named Cplot.class in /A/C.
: When run it, it gives message:
: "Exception in thread "main" java.lang.NoClassDefFoundError: Cplot".
: I find since classpath is set as /A, java cannot find this Cplot.
: So I add /A/C to the classpath, but it gives message:
: "Exception in thread "main" java.lang.NoClassDefFoundError: Cplot (wrong name:
: A/C/Cplot).

r*****l
发帖数: 2859
3
cd to /A and run it.

【在 q**c 的大作中提到】
: say I have two packages B and C put as
: in the directory /A/B and /A/C. The classpath is set as /A.
: so when compiling them, no problem at all.
: Now have a test class named Cplot.class in /A/C.
: When run it, it gives message:
: "Exception in thread "main" java.lang.NoClassDefFoundError: Cplot".
: I find since classpath is set as /A, java cannot find this Cplot.
: So I add /A/C to the classpath, but it gives message:
: "Exception in thread "main" java.lang.NoClassDefFoundError: Cplot (wrong name:
: A/C/Cplot).

1 (共1页)
进入Java版参与讨论
相关主题
Unix: where to execute java program?Re: How to compile a Java program with import my own package in UNIX
com.sun.tools.javac.Main 问题[转载] Anybody tried "gcj"?
[转载] how to compile Azureus??入门Java CLASSPATH问题:
Exception in thread "main" java.lang.NoClassDefFoundError为何运行JAVA出现这个错误?
weird class definitionJBuilder question
一个怪异的java 运行问题新手求助,急急急!!!
问一个 java generic问题如何从java中调用Matlab
ant javac error in eclipse 3.0?java & XML 2 example problem
相关话题的讨论汇总
话题: cplot话题: classpath话题: exception话题: when话题: so