「java执行失败」java报错继续执行
本篇文章给大家谈谈java执行失败,以及java报错继续执行对应的知识点,希望对各位有所帮助,不要忘了收藏本站喔。
本文目录一览:
java 运行错误
分类: 电脑/网络 程序设计 其他编程语言
问题描述:
不知道怎么回事,环境变量我也设置好了, 没有问题,可是每次编译的时候总会出现错误提示:
C:\Documents and Settings\user\桌面javac HelloWorld.class
javac: invalid flag: HelloWorld.class
Usage: javac options source files
where possible options include:
-g Generate all debugging info
-g:none Generate no debugging info
-g:{lines,vars,source} Generate only some debugging info
-nowarn Generate no warnings
-verbose Output messages about what the piler is doing
-deprecation Output source locations where deprecated APIs are u
sed
-classpath path Specify where to find user class files
-cp path Specify where to find user class files
-sourcepath path Specify where to find input source files
-bootclasspath path Override location of bootstrap class files
-extdirs dirs Override location of installed extensions
-endorseddirs dirs Override location of endorsed standards path
-d directory Specify where to place generated class files
-encoding encoding Specify character encoding used by source files
-source release Provide source patibility with specified release
-target release Generate class files for specific VM version
-version Version information
-help Print a synopsis of standard options
-X Print a synopsis of nonstandard options
-Jflag Pass flag directly to the runtime system
不知道是那里没有搞好,请高手指点!
解析:
javac命令是用来编译java源文件的,即以.java结尾的文件
java命令用来执行编译之后形成的class文件,你把两个命令搞混了
java多线程调用同步方法时,休眠后代码为什么执行不到
1、java多线程调用同步方法时主程序或者后台服务Service程序两者必须有一个正在运行着,定时任务才会执行。
2、自动执行的任务可以设置开启或关闭定时,检查任务的这一开关处于开启状态。
3、源目录在定时的时间点如果没有变化,任务执行后不会留下日志,通过查看任务的最后执行时间确定任务到底执行了没有。
4、执行失败和没有执行不是同一回事,如果是执行失败则要分析失败原因。这是java多线程调用同步方法时,休眠后代码执行不到的原因。
java 执行出错
你的
classpath
设置错误,这里要配置java文件编译后的保存目录,现在报错就是在classpath目录和d盘根目录下没有找到A.class.
这里就是一个目录,你设置任意目录都可以,但是你执行java命令前,要把clas文件放到classpath目录下,不然java命令就找不到class,你可以象楼上说的,在文件前加上路径执行,建议你在现在的配置后面加一个目录,把A.class复制过去在试试.
JDK装好以后javac编译成功了class文件,为什么Java执行失败?
可能是你的java
环境变量
配的不正确,
你在cmd里打java
,看一下出来的是不是和javac一样
如果不是,就是你的环境变量不正确.
java执行失败的介绍就聊到这里吧,感谢你花时间阅读本站内容,更多关于java报错继续执行、java执行失败的信息别忘了在本站进行查找喔。
发布于:2022-12-27,除非注明,否则均为
原创文章,转载请注明出处。