Could not find or load main class Hello
在 linux 下写了一个非常简单的 Hello World 程序,编译正常,运行报错:Error: Could not find or load main class Hello
这是由于 CLASSPATH 配置不当导致的,我们需要检查一下 CLASSPATH 后面是否有英文状态下的“.:”。
主要在环境变量这块:
export JAVA_HOME=/usr/java/jdk1.8.0
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib
export PATH=${JAVA_HOME}/bin:$PATH
CLASSPATH=后面一定要加上英文状态下的“.:”(不含中文状态下的双引号)。
更新后需要执行 source /etc/profile 命令重新加载此文件。
Could not find or load main class Hello的更多相关文章
- Error: Could not find or load main class test.EditFile
今天写了一个简单的小程序,运行之后发现Error: Could not find or load main class test.EditFile,项目无法启动.删除main中的所有内容之后依旧提示该 ...
- Eclipse報錯:Could not find or load main class
代碼正確,但在Eclipse中無法運行,一直報錯: Could not find or load main class
- Hadoop could not find or load main class
Error: Could not find or load main class <class_name> 我在尝试使用hadoop definitive guide的代码做练习时,遇到一 ...
- Linux 下 Error: Could not find or load main class Hello
在linux下写了一个很easy的Hello world程序,编译执行居然报错:Error: Could not find or load main class Hello 最后发现是CLASSPAT ...
- Error: Could not find or load main class Test
问题描述 Linux 环境下运行 Java 程序时,执行 javac Test.java 生成 Test.class 文件,再执行 java Test 时报错:Error: Could not fin ...
- Sqoop找不到主类 Error: Could not find or load main class org.apache.sqoop.Sqoop
最近由于要使用Sqoop来到出数据到hdfs,可是发现Sqoop1.4.5跟hadoop2.X不兼容,需要对Sqoop1.4.5进行编译,编译的具体方法见:http://my.codeweblog.c ...
- Could not find or load main class org.apache.spark.deploy.yarn.ApplicationMaster
Spark YARN Cluster mode get this error "Could not find or load main class org.apache.spark.depl ...
- [sloved] IDE JavaServlet "Error: Could not find or load main class Servlet"
[ sloved ] JavaServlet "Error: Could not find or load main class Servlet" 报错内容: 提供一份 Servl ...
- 【java】Could not find or load main class
https://stackoverflow.com/questions/18093928/what-does-could-not-find-or-load-main-class-mean A comm ...
- Error: Could not find or load main class org.apache.flume.tools.GetJavaProperty
问题: [root@master conf]# flume-ng version Error: Could not find or load main class org.apache.flume.t ...
随机推荐
- Eclipse中Spring插件的安装及使用
一.安装流程 1.Help——Install New Software——在Work With中添加地址http://dist.springsource.com/release/TOOLS/updat ...
- luogu3380 树套树之线段树套线段树
个人感觉可能是最不需要脑子写的方法 不过也不太好调 就是用一个普通的线段树维护这个序列,但是对于线段树的每一个区间,再开一个动态开点的权值线段树,里面存储这个区间所有元素值 单点修改只会涉及到log棵 ...
- JDK 1.6.0_45 下载
Java SE Development Kit 6u45 Product / File Description File Size Download password Linux x86 65.46 ...
- html5 语音识别 转
- java Sprint boot 学习之一
<properties> <project.build.sourceEncoding>UTF-</project.build.sourceEncoding> < ...
- datatables通过ajax调用渲染数据,怎么根据数据给td添加class
html: <table id="table8" cellpadding="0" cellspacing="0" border=&qu ...
- WPF Canvas转换为位图 (RenderTargetBitmap)
使用 RenderTargetBitmap 的注意事项: 1. 要渲染的Canvas元素要放在Border元素内,并且此Border元素不能设置边框宽度(BorderThickness),不然生成的位 ...
- Go语言基础之1--标识符、关键字、变量和常量、数据类型、Go的基本程序结构、Golang的特性
一.前言 当我们项目较为简单时,我们在src目录下新建一个该项目目录,里面存放源码文件即可,见下图: 当我们一个项目较为复杂时,我们可以在src目录下新建一个该项目目录,在针对该项目不同模块创建不同目 ...
- etcd介绍
etcd是一个开源的.分布式的键值对数据存储系统,提供共享配置.服务的注册和发现. etcd与zookeeper相比算是轻量级系统.etcd的raft比zookeeper的paxos简单. 我们用et ...
- 用vector实现二维向量
如果一个向量的每一个元素是一个向量,则称为二维向量,例如 vector<vector<int> >vv(3, vector<int>(4));//这里,两个“> ...