惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - 司徒正美
T
The Blog of Author Tim Ferriss
F
Fortinet All Blogs
Martin Fowler
Martin Fowler
罗磊的独立博客
The GitHub Blog
The GitHub Blog
L
LangChain Blog
A
About on SuperTechFans
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
D
DataBreaches.Net
宝玉的分享
宝玉的分享
U
Unit 42
阮一峰的网络日志
阮一峰的网络日志
Last Week in AI
Last Week in AI
N
Netflix TechBlog - Medium
The Cloudflare Blog
Microsoft Azure Blog
Microsoft Azure Blog
H
Help Net Security
美团技术团队
大猫的无限游戏
大猫的无限游戏
雷峰网
雷峰网
爱范儿
爱范儿
酷 壳 – CoolShell
酷 壳 – CoolShell
MongoDB | Blog
MongoDB | Blog

博客园 - Gravitonium

AttributesError:XXXXX has no module named 'xfeatures2d' Install pyCuda on windows7 Install pytorch on windows7 Install face_recognition anaconda to install cv2 Install dlib on windows for python2.7 Solution for Python Extention matplotlib.pyplot loading Error Reactivate this account after 8-year-suspension RealPlayer10GOLD for FC5 installation problem Date comparison in SQL clauses How to sort out monitor "Sync out of range" problem for Linux Box VS.net 2003 “Linker Tools Error LNK2001” 解决方案 Solution to MySQL Connection Problem Example of a Web client invoke WebService using ASP Demonstration of Database programming using ADO.net with C# under console mode 彻底清除3721上网助手 How to remove rigistry entry from the list of services PERL之模式匹配 Access数据库执行insert语句产生的问题
Java programming problem in linux box: Exception in threa...
Gravitonium · 2005-02-06 · via 博客园 - Gravitonium

Most people always have the following problem when run their java programs under linux box:
Exception in thread "main" java.lang.NoClassDefFoundError: *.java
Even though these programs  really have no problem at all.
Here are some solutions for you:
1) Check your syntax that you are trying to run the java class and make sure it should be like this (assume the class file is foo.class):
java  foo      instead of    java  foo.class

2) Make sure your classpath contain the special path ".", actually this is most likely where the problem come from. 
You can try to run your program as follows.

java -cp .  foo   or
java  -classpath  .  foo

If it works, then you are suppose to add "." to you classpath.
For example:
export CLASSPATH=.:$JAVA_HOME/lib:JAVA_HOME/jre/lib

3) Check it out if you compiled the java file without specifying the package that import in your file.

What if all these works are done, but your still got the same problem?
Well, in this case, you've got to have a look at your souce code......

Good luck!