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

推荐订阅源

P
Privacy & Cybersecurity Law Blog
V
V2EX
月光博客
月光博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
The Register - Security
The Register - Security
MongoDB | Blog
MongoDB | Blog
P
Privacy International News Feed
The Last Watchdog
The Last Watchdog
Security Archives - TechRepublic
Security Archives - TechRepublic
美团技术团队
Stack Overflow Blog
Stack Overflow Blog
博客园 - 司徒正美
博客园 - 三生石上(FineUI控件)
V
Visual Studio Blog
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
K
Kaspersky official blog
S
Secure Thoughts
T
Tenable Blog
Security Latest
Security Latest
The Cloudflare Blog
S
Security @ Cisco Blogs
H
Heimdal Security Blog
aimingoo的专栏
aimingoo的专栏
TaoSecurity Blog
TaoSecurity Blog
Blog — PlanetScale
Blog — PlanetScale
Microsoft Security Blog
Microsoft Security Blog
Schneier on Security
Schneier on Security
Webroot Blog
Webroot Blog
G
Google Developers Blog
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Scott Helme
Scott Helme
IT之家
IT之家
Latest news
Latest news
The Hacker News
The Hacker News
C
Check Point Blog
T
The Exploit Database - CXSecurity.com
H
Hackread – Cybersecurity News, Data Breaches, AI and More
腾讯CDC
C
CERT Recently Published Vulnerability Notes
NISL@THU
NISL@THU
N
News | PayPal Newsroom
Forbes - Security
Forbes - Security
P
Palo Alto Networks Blog
S
Security Affairs
S
Securelist
Google Online Security Blog
Google Online Security Blog
WordPress大学
WordPress大学
Last Week in AI
Last Week in AI
C
Cybersecurity and Infrastructure Security Agency CISA
A
About on SuperTechFans

博客园 - 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 thread "main" java.lang.NoClassDefFoundError
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!