c**t 发帖数: 26 | 1 in hell.java class, I define it
import ....;
public class hell
{
private float var1=1;
public hell()
{
...;
}
...
public static void main()
{
hell a = new hell();
....
}
}
when I compile it, no problem. but when run java hell.class
it tells me Exception in thread "main" java.lang.NoClassDefFoundError
Anything wrong? |
T***B 发帖数: 137 | 2 java hell
【在 c**t 的大作中提到】 : in hell.java class, I define it : import ....; : public class hell : { : private float var1=1; : : public hell() : { : ...; : }
|
c**t 发帖数: 26 | 3 same error
【在 T***B 的大作中提到】 : java hell
|
T***B 发帖数: 137 | 4 java -classpath . hell
【在 c**t 的大作中提到】 : same error
|
c**t 发帖数: 26 | 5 same error
【在 T***B 的大作中提到】 : java -classpath . hell
|
m******t 发帖数: 2416 | 6 Do you have file hell.class under the current directory
when you try it?
【在 c**t 的大作中提到】 : same error
|
T***B 发帖数: 137 | 7 write a 'hello world' and try again.
【在 c**t 的大作中提到】 : same error
|
c**t 发帖数: 26 | 8 if not use -classpth ., hello world will havve the same error
so it seems classpath error.
but I used classpath when run hell, still the same error
sounds weird
write a 'hello world' and try again.
【在 T***B 的大作中提到】 : write a 'hello world' and try again.
|
T***B 发帖数: 137 | 9 do you use 'package' in your code?
【在 c**t 的大作中提到】 : if not use -classpth ., hello world will havve the same error : so it seems classpath error. : but I used classpath when run hell, still the same error : sounds weird : : write a 'hello world' and try again.
|
c**t 发帖数: 26 | 10 I comment it. So no 'package'
【在 T***B 的大作中提到】 : do you use 'package' in your code?
|
T***B 发帖数: 137 | 11 still stuck? you may post a simplified version of your code here.
【在 c**t 的大作中提到】 : I comment it. So no 'package'
|
e***e 发帖数: 351 | 12 so funny
try
public static void main(String[] args) {
}
【在 T***B 的大作中提到】 : java hell
|
v******e 发帖数: 63 | 13 post your full stacktrace. Which class it can't find?
【在 c**t 的大作中提到】 : in hell.java class, I define it : import ....; : public class hell : { : private float var1=1; : : public hell() : { : ...; : }
|