2016-02-17 36 views
2

Getting started - (Windows 7中,控制台:C:...>的.jar在同一文件夹& .javauto)Javauto编译失败(入门)

java -jar javauto.jar    => OK, help is displayed 
javauto hello.javauto    => command not recognised     
javauto.jar hello.javauto   => NO result 

所以我想这

java -jar javauto.jar -v hello.javauto 

给予此异常(注:C:...>的javac =>帮助显示为OK)

Generating ←[92mhello←[0m... 
Getting user imports... None 
Getting user global variables... None 
Getting user functions... None 
Generating functions... ←[93mmouseMove ←[0m←[93mmsgBox ←[0m←[93mprint ←[0m←[93msleep ←[0m 
Generating class variables... ←[93msimulatedMotionSpeed ←[0m 
Generating imports... ←[93mAWTException ←[0m←[93mMouseInfo ←[0m←[93mRobot ←[0m←[93mJDialog ←[0m←[93 
mJOptionPane ←[0m 
Generating struct objects... None 
Generation complete... starting build 
Executing cmd /c attrib +s +h "C:\Users\Francis\Develop\java\Javauto\.hello"... 
Building ←[92mC:\Users\Francis\Develop\java\Javauto\.hello\class\hello.class←[0m... 
Exception in thread "main" java.lang.NullPointerException: Couldn't find java system compiler. 
    at com.automation.javauto.compiler.CustomJavaCompiler.compile(CustomJavaCompiler.java:36) 
    at com.automation.javauto.parser.Create.main(Create.java:419) 
+0

你有JAVA_HOME设置,以及PATH上的jdk? – azurefrog

+0

我能想到的唯一的另一件事是,也许你的javac是一个很奇怪的地方,并且javauto在尝试执行时错误地解析路径? – azurefrog

+0

Environment is OK(javac编译在javauto外部): JAVA_HOME = C:\ Program Files(x86)\ Java \ jdk1.8.0_74 - - - Path = C:\ Program Files(x86)\ Java \ jdk1.8.0_74 \ bin – Francis

回答

0

试试这个:

1)使用这个命令编译:

java -jar javauto.jar hello.javauto    

2)现在你已经编译程序时,会有一个叫hello.jar文件。执行:

java -jar hello.jar 
+0

谢谢,这就是我所做的......导致了上述例外。 – Francis

+0

“线程中的异常”main“java.lang.NullPointerException”==>一些帮助:http://howtodoinjava.com/core-java/exception-handling/how-to-effectively-handle-nullpointerexception-in-java/ – Francis