javac: invalid flag: 'C:\haikuVM\examples\src\main\java\processing\examples_01_B
asics\Blink.java'
Usage: javac <options>
use -help for a list of possible options
Last edit: Chris 2014-04-26
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
javac: file not found: C:\haikuVM\examples\src\main\java\processing\examples_01_
Basics\Blink.java
Usage: javac <options>
use -help for a list of possible options
Last edit: Chris 2014-04-26
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
"[No return]" is good return - I guess. At least javac of JAVA 8 is running. So, I expect to have some directories and *.class files in: "C:/Users/CHRIST~1/AppData/Local/Temp/haikuvm". (See used option '-d' of javac.)
But javac is called indirect if used with HaikuVM and is actually called like this:
haiku.bat -> haikuc.bat -> make.exe -> javac.exe
Your first post reported an error code 2. So, I have two sources for this: make.exe or javac.exe
Check which make.exe is used. May be there is another make.exe on your system and in your PATH which is incompatible with HaikuVM.
Force haikuc.bat to use make.exe from HaikuVM (instead of the conflicting make) by changing line 81:
set PATH=%PATH%;%NXJ_HOME%\hardware\tools\avr\utils\bin
into
set PATH=%NXJ_HOME%\hardware\tools\avr\utils\bin;%PATH%
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
But, I hate this markdown-syntax. E.g. nobody tells you that the intro "~~~~~~" has to be prefixed with an empty line. Between the intro "~~~~~~" and the extro "~~~~~~" each line has to begin with 4 blanks. (Until today I didn't find out how to express some blanks at the begin of a line.)
OT end
1: This is ok
4: In other words: No change :-(
5 . So we have to focus on the error code of javac.exe of JAVA 8. Please delete directory "C:/Users/CHRIST~1/AppData/Local/Temp/haikuvm". Then check the error code of javac.exe like this:
I expect to see ERRORLEVEL 2. And, I expect to see the directory "C:/Users/CHRIST~1/AppData/Local/Temp/haikuvm" to be properly rebuild. (This is with *.class files at the leafs of the rebuild directory tree.) If so, then javac.exe emits error code 2 if every thing is fine - I guess. Can you confirm this?
Last edit: genom2 2014-04-28
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Meanwhile I installed JAVA 8 on WIN7 (JAVA_HOME=C:\Program Files\Java\jdk1.8.0_05) and made some investigations. Conclusion: Everything works fine for me with JAVA 8 !!!!!
May be this is of some help for you. So far, it's not a fault of HaikuVM.
Potential workaround 1: Assuming javac.exe did all its work but just emitting errorcode -1073741502. Then append " ; true" at line 2 in file "bin\makeclasses.mk" like this:
I have the same problem as chris (WIN8.1, JAVA8).
5. error code emitted is 2, but the directory ".. AppData/Local/Temp/haikuvm" is empty. workaround 1 did not help.
downgrade to JAVA7 did not work either.
Thanks for investigating, but sadly I have to move on. Mainly because I do not have any Arduino anymore, they were borrowed from my school.
The only difference between our installs that I can see is that my machine runs on a Win8.
I am maybe coming back later, because now I am on a RasPi but with different goals.
Thanks for the help and good luck!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm having the same issue. Could this be related to the fact that my java installation is 64bit? What exactly is the error, complaining about? Is it caused during the compile phase?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
JAVA 8 (jdk1.8.0_05) seams not the single reason. (See my 2014-05-01 post)
JAVA 64bit seams not the single reason.
WIN8.1 seams not the single reason. (Because meanwhile I tried it and it works.)
May be it's due to the fact that everybody(?) in this thread tries HaikuVM to run with ArduinoIDE in WIN8?
What about you? ArduinoIDE? In this case did you try the test of my 2014-06-03 post?
Kind regards
Bob
Last edit: genom2 2014-07-11
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
does anyone in this thread is already using:
- cygwin and/or
- WinAVR
on his WIN8 System?
The different sh.exe's and wrong PATH positions are candidates for the root of this problem.
That sounds like good news!
Are you really telling me, you solved the issue by replacing the call of %MAKE% ... by your call of haikumake.bat ...?
That's interesting! I will test and implement your solution for and in HaikuVM 1.2.4. Thanks!
Another question: Are you using Windows 8.1 home (alias basic) or Windows 8.1 professional? (Because, in the past, I couldn't reproduce this issue with Windows 8.1 professional. See my post from 2014-07-11.)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
When I tries to compile Blink.java, I receive the error-message bellow. Any idea what's wrong?
Batch-file:
cd C:\Program Files (x86)\Arduino\libraries
C:\haikuVM\bin\haiku -v --Config arduinoIDE C:\haikuVM\examples\src\main\java\processing\examples_01_Basics\Blink.java
Return:
C:\haikuVM\bin\haiku -v --Config arduinoIDE C:\haikuVM\examples\src\main\java\processing\examples_01_Basics\Blink.java
Looking for 'HaikuVM.properties' in path: 'C:\Program Files (x86)\Arduino\libraries';'C:\haikuVM\config'
Loaded from 'C:\haikuVM\config\HaikuVM.properties'
$Version 1.2.1 $ $Date: 2014-03-01 17:39:20 +0100 (Sa, 01 Mrz 2014) $
C:\haikuVM\bin../bin/haikuc C:\haikuVM\examples\src\main\java\processing\examples_01_Basics\Blink.java
generating class files
"C:/Program Files/Java/jdk1.8.0_05/bin/javac.exe" -bootclasspath "" -extdirs "" -classpath 'C:\haikuVM\bin..\haikuRT\src\main\java;C:\haikuVM\bin..\lib\nxt\classes.jar;C:\haikuVM\bin..\bootstrap\src\main\java;C:\haikuVM\bin..\examples\src\main\java;C:\haikuVM\bin..\haikuBench\src\main\java;C:\haikuVM\bin..\gallerie\src\main\java;C:\haikuVM\bin..\incubator\src\main\java;C:\Users\CHRIST~1\AppData\Local\Temp\haikuvm' -d 'C:\Users\CHRIST~1\AppData\Local\Temp\haikuvm' 'C:\haikuVM\examples\src\main\java\processing\examples_01_Basics\Blink.java' 'C:\haikuVM\bootstrap\src\main\java\haiku\avr\lib\arduino\HaikuMicroKernel.java' 'C:\haikuVM\bootstrap\src\main\java\haiku\avr\lib\arduino\HaikuMicroKernel4ArduinoIDE.java' 'C:\haikuVM\bootstrap\src\main\java\haiku\avr\lib\arduino\HaikuMicroKernelEx.java' 'C:\haikuVM\bootstrap\src\main\java\haiku\avr\lib\arduino\HaikuMicroKernelLib.java' 'C:\haikuVM\bootstrap\src\main\java\haiku\avr\lib\arduino\HaikuMicroKernelProcessing.java' 'C:\haikuVM\bootstrap\src\main\java\haiku\avr\lib\asuro\lib2_8_0_rc1\HaikuMicroKernel.java' 'C:\haikuVM\bootstrap\src\main\java\haiku\avr\lib\asuro\lib2_8_0_rc1\HaikuMicroKernelEx.java' 'C:\haikuVM\bootstrap\src\main\java\haiku\avr\lib\asuro\nanovm\HaikuMicroKernel.java' 'C:\haikuVM\bootstrap\src\main\java\haiku\avr\lib\simple010\HaikuMicroKernel.java' 'C:\haikuVM\bootstrap\src\main\java\haiku\pc\lib\HaikuMicroKernel.java' 'C:\haikuVM\bootstrap\src\main\java\haiku\vm\MicroKernel.java'

Error 2 while generating class file(s)
Last edit: Chris 2014-04-24
Hello Chris,
it might be JAVA 8 causeing the problem. Until now I have no experience with JAVA 8. So, I offer two alternatives:
Downgrade to JAVA 7 and tell me the result.
Call JAVA 8 direct (not via C:\haikuVM\bin\haiku) like this:
And tell/cut&past me the resulting output.
Last edit: genom2 2014-04-26
I'll do that as soon as I have time. (Probably later today.)
I couldn't resist...
EDIT: Forgot @ECHO off.
Return:
javac: invalid flag: 'C:\haikuVM\examples\src\main\java\processing\examples_01_B
asics\Blink.java'
Usage: javac <options>
use -help for a list of possible options
Last edit: Chris 2014-04-26
Hello Chris,
thank you for trying. Sorry, but I made two mistakes in my advice 2.
Normaly, when called via C:\haikuVM\bin\haiku, fixes 1 and 2 are not needed. Please try this fixed commands:
And tell/cut&past me the resulting output.
Last edit: genom2 2014-04-26
Maybe should add that I did see anything new in the libraries-folder.
Ok, so what are you using?
1. The official version 1.2.1 or
2. Some last release from the SVN trunk
The official, 1.2.1
Sorry, I didn't see your edit before my "Maybe should add that I did see anything new in the libraries-folder."-post. The browser wasn't refreshed. :)
EDIT: How do you get one-row-code? I when I follow the syntax, I can only make it into a header.
Batch:
cd C:\Program Files (x86)\Arduino\libraries
"C:/Program Files/Java/jdk1.8.0_05/bin/javac.exe" -bootclasspath "" -extdirs "" -classpath "C:/haikuVM/bin/../haikuRT/src/main/java;C:/haikuVM/bin/../lib/nxt/classes.jar;C:/haikuVM/bin/../bootstrap/src/main/java;C:/haikuVM/bin/../examples/src/main/java;C:/haikuVM/bin/../haikuBench/src/main/java;C:/haikuVM/bin/../gallerie/src/main/java;C:/haikuVM/bin/../incubator/src/main/java;C:/Users/CHRIST~1/AppData/Local/Temp/haikuvm" -d "C:/Users/CHRIST~1/AppData/Local/Temp/haikuvm" "C:/haikuVM/examples/src/main/java/processing/examples_01_Basics/Blink.java" "C:/haikuVM/bootstrap/src/main/java/haiku/avr/lib/arduino/HaikuMicroKernel.java" "C:/haikuVM/bootstrap/src/main/java/haiku/avr/lib/arduino/HaikuMicroKernel4ArduinoIDE.java" "C:/haikuVM/bootstrap/src/main/java/haiku/avr/lib/arduino/HaikuMicroKernelEx.java" "C:/haikuVM/bootstrap/src/main/java/haiku/avr/lib/arduino/HaikuMicroKernelLib.java" "C:/haikuVM/bootstrap/src/main/java/haiku/avr/lib/arduino/HaikuMicroKernelProcessing.java" "C:/haikuVM/bootstrap/src/main/java/haiku/avr/lib/asuro/lib2_8_0_rc1/HaikuMicroKernel.java" "C:/haikuVM/bootstrap/src/main/java/haiku/avr/lib/asuro/lib2_8_0_rc1/HaikuMicroKernelEx.java" "C:/haikuVM/bootstrap/src/main/java/haiku/avr/lib/asuro/nanovm/HaikuMicroKernel.java" "C:/haikuVM/bootstrap/src/main/java/haiku/avr/lib/simple010/HaikuMicroKernel.java" "C:/haikuVM/bootstrap/src/main/java/haiku/pc/lib/HaikuMicroKernel.java" "C:/haikuVM/bootstrap/src/main/java/haiku/vm/MicroKernel.java"
Return:
javac: file not found: C:\haikuVM\examples\src\main\java\processing\examples_01_
Basics\Blink.java
Usage: javac <options>
use -help for a list of possible options
Last edit: Chris 2014-04-26
Fixed the missing "\"
examples_01_Basics\Blink.java -> examples\_01_Basics\Blink.java
It seems to be removed by the forum..
Return
[No return]
No new folder in Arduino\libraries either.
Last edit: Chris 2014-04-26
"[No return]" is good return - I guess. At least javac of JAVA 8 is running. So, I expect to have some directories and *.class files in: "C:/Users/CHRIST~1/AppData/Local/Temp/haikuvm". (See used option '-d' of javac.)
But javac is called indirect if used with HaikuVM and is actually called like this:
haiku.bat -> haikuc.bat -> make.exe -> javac.exe
Your first post reported an error code 2. So, I have two sources for this: make.exe or javac.exe
Check which make.exe is used. May be there is another make.exe on your system and in your PATH which is incompatible with HaikuVM.
Force haikuc.bat to use make.exe from HaikuVM (instead of the conflicting make) by changing line 81:
1: There are folders in Temp/haikuvm, but no files. (But the folders in haikuvm does contains files.)
4: I change that line and I got this in return.
Return:
C:\haikuVM\bin\haiku -v --Config arduinoIDE C:\haikuVM\examples\src\main\java\processing\examples_01_Basics\Blink.java
Looking for 'HaikuVM.properties' in path: 'C:\Program Files (x86)\Arduino\libraries';'C:\haikuVM\config'
Loaded from 'C:\haikuVM\config\HaikuVM.properties'
$Version 1.2.1 $ $Date: 2014-03-01 17:39:20 +0100 (Sa, 01 Mrz 2014) $
C:\haikuVM\bin../bin/haikuc C:\haikuVM\examples\src\main\java\processing\examples_01_Basics\Blink.java
generating class files
"C:/Program Files/Java/jdk1.8.0_05/bin/javac.exe" -bootclasspath "" -extdirs "" -classpath 'C:\haikuVM\bin..\haikuRT\src\main\java;C:\haikuVM\bin..\lib\nxt\classes.jar;C:\haikuVM\bin..\bootstrap\src\main\java;C:\haikuVM\bin..\examples\src\main\java;C:\haikuVM\bin..\haikuBench\src\main\java;C:\haikuVM\bin..\gallerie\src\main\java;C:\haikuVM\bin..\incubator\src\main\java;C:\Users\CHRIST~1\AppData\Local\Temp\haikuvm' -d 'C:\Users\CHRIST~1\AppData\Local\Temp\haikuvm' 'C:\haikuVM\examples\src\main\java\processing\examples_01_Basics\Blink.java' 'C:\haikuVM\bootstrap\src\main\java\haiku\avr\lib\arduino\HaikuMicroKernel.java' 'C:\haikuVM\bootstrap\src\main\java\haiku\avr\lib\arduino\HaikuMicroKernel4ArduinoIDE.java' 'C:\haikuVM\bootstrap\src\main\java\haiku\avr\lib\arduino\HaikuMicroKernelEx.java' 'C:\haikuVM\bootstrap\src\main\java\haiku\avr\lib\arduino\HaikuMicroKernelLib.java' 'C:\haikuVM\bootstrap\src\main\java\haiku\avr\lib\arduino\HaikuMicroKernelProcessing.java' 'C:\haikuVM\bootstrap\src\main\java\haiku\avr\lib\asuro\lib2_8_0_rc1\HaikuMicroKernel.java' 'C:\haikuVM\bootstrap\src\main\java\haiku\avr\lib\asuro\lib2_8_0_rc1\HaikuMicroKernelEx.java' 'C:\haikuVM\bootstrap\src\main\java\haiku\avr\lib\asuro\nanovm\HaikuMicroKernel.java' 'C:\haikuVM\bootstrap\src\main\java\haiku\avr\lib\simple010\HaikuMicroKernel.java' 'C:\haikuVM\bootstrap\src\main\java\haiku\pc\lib\HaikuMicroKernel.java' 'C:\haikuVM\bootstrap\src\main\java\haiku\vm\MicroKernel.java'

Error 2 while generating class file(s)
Last edit: Chris 2014-04-28
OT begin
"How do you get one-row-code" like this:
You have to code it like this:
But, I hate this markdown-syntax. E.g. nobody tells you that the intro "~~~~~~" has to be prefixed with an empty line. Between the intro "~~~~~~" and the extro "~~~~~~" each line has to begin with 4 blanks. (Until today I didn't find out how to express some blanks at the begin of a line.)
OT end
1: This is ok
4: In other words: No change :-(
5 . So we have to focus on the error code of javac.exe of JAVA 8. Please delete directory "C:/Users/CHRIST~1/AppData/Local/Temp/haikuvm". Then check the error code of javac.exe like this:
I expect to see ERRORLEVEL 2. And, I expect to see the directory "C:/Users/CHRIST~1/AppData/Local/Temp/haikuvm" to be properly rebuild. (This is with *.class files at the leafs of the rebuild directory tree.) If so, then javac.exe emits error code 2 if every thing is fine - I guess. Can you confirm this?
Last edit: genom2 2014-04-28
Meanwhile I installed JAVA 8 on WIN7 (JAVA_HOME=C:\Program Files\Java\jdk1.8.0_05) and made some investigations. Conclusion: Everything works fine for me with JAVA 8 !!!!!
So I searched for your error code 1073741502. And found (beside others) this:
http://stackoverflow.com/questions/9686254/the-compiler-failed-with-error-code-1073741502-sharepoint-2010-sp1-running-on
May be this is of some help for you. So far, it's not a fault of HaikuVM.
Potential workaround 1: Assuming javac.exe did all its work but just emitting errorcode -1073741502. Then append " ; true" at line 2 in file "bin\makeclasses.mk" like this:
Last edit: genom2 2014-05-01
Hello,
I have the same problem as chris (WIN8.1, JAVA8).
5. error code emitted is 2, but the directory ".. AppData/Local/Temp/haikuvm" is empty. workaround 1 did not help.
downgrade to JAVA7 did not work either.
Hello jakub,
what do you mean with workaround 1?
Did you try:
4.Force haikuc.bat to use make.exe from HaikuVM (instead of the conflicting make) by changing line 81:
from my post at 2014-04-26?
Kind regards
Bob
Thanks for investigating, but sadly I have to move on. Mainly because I do not have any Arduino anymore, they were borrowed from my school.
The only difference between our installs that I can see is that my machine runs on a Win8.
I am maybe coming back later, because now I am on a RasPi but with different goals.
Thanks for the help and good luck!
Hello Chris, hello jakub,
please check for write permission and make this simple test:
Kind regards
Bob
Last edit: genom2 2014-06-04
I'm having the same issue. Could this be related to the fact that my java installation is 64bit? What exactly is the error, complaining about? Is it caused during the compile phase?
Hello Ellison Chan,
I have no idea what's wrong here.
May be it's due to the fact that everybody(?) in this thread tries HaikuVM to run with ArduinoIDE in WIN8?
What about you? ArduinoIDE? In this case did you try the test of my 2014-06-03 post?
Kind regards
Bob
Last edit: genom2 2014-07-11
Hello,
does anyone in this thread is already using:
- cygwin and/or
- WinAVR
on his WIN8 System?
The different sh.exe's and wrong PATH positions are candidates for the root of this problem.
In this case try copying file 'msys-1.0.dll' in:
http://www.madwizard.org/download/electronics/msys-1.0-vista64.zip
to utils\bin directory of WinAVR. And make sure that WinAVR's sh.exe is taken.
See here
http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=138938
for a discussion.
Feedback is wanted, thanks.
Similar problems running Java 1.8 or Java 1.6.
I am using haikuJava version 1.2.3
Windows 8.1
ArduinoIDE 1.0.6
The issue for me was the call to make from haikuc.bat;
"%MAKE%" -f %NXJ_HOME%/bin/makeclasses.mk all
I replaced this line with a call to a batch file that calls javac;
call c:\haikuVM\bin\haikumake.bat "%HAIKU_KERNELS%" %ARG%"
haikumake.bat contains;
javac.exe -bootclasspath C:\haikuVM\lib\nxt\classes.jar -extdirs "" -classpath ';C:\haikuVM\bin..\haikuRT\src\main\java;C:\haikuVM\bin..\bootstrap\src\main\java;C:\haikuVM\bin..\examples\src\main\java;C:\haikuVM\bin..\haikuBench\src\main\java;C:\haikuVM\bin..\gallerie\src\main\java;C:\haikuVM\bin..\incubator\src\main\java' -d C:\Users\JASON~1.WIS\AppData\Local\Temp\haikuvm %~1 %~2
That sounds like good news!
Are you really telling me, you solved the issue by replacing the call of %MAKE% ... by your call of haikumake.bat ...?
That's interesting! I will test and implement your solution for and in HaikuVM 1.2.4. Thanks!
Another question: Are you using Windows 8.1 home (alias basic) or Windows 8.1 professional? (Because, in the past, I couldn't reproduce this issue with Windows 8.1 professional. See my post from 2014-07-11.)