I'm unable to get haiku.bat to do the right thing when my java project has multiple files. My project looks like this:
src
- com
---- pp
------ Blink.java
------ Wire.java
Blink.java has hte loop and setup methods and also references methods in Wire.java. If I remove Wire .java (and references to it) and run the following command, everything works great (all code is generated, no errors):
D:\software\haikuvm132\bin\haiku.bat -v --Config arduinoIDE F:\workspace\adxl35\src\com\pp\Blink.java
If I have Wire.java and references to it, and run the above command, the compilation step fails since the Wire.java is not passed to javac. I won't post the full trace here, but here's one of the errors:
symbol: variable Wire
location: class Blink
F:\workspace\adxl35\src\com\pp\Blink.java:98: error: cannot find symbol
Wire.endTransmission(); // false / don't release device /
^
What switches do I need to use on the haiku.bat command for it to do the right thing? I'm using the latest release (1.3.2)
Thanks!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
But, I do have to admit that my documentation is not very explicit on this. (Just a small hint in my FAQs: "Q: Is it possible to compile against a JAR library with HaikuVM?")
The default classpath of HaikuVM is (as defined in './bin/makeclasses.mk'):
I'm unable to get haiku.bat to do the right thing when my java project has multiple files. My project looks like this:
src
- com
---- pp
------ Blink.java
------ Wire.java
Blink.java has hte loop and setup methods and also references methods in Wire.java. If I remove Wire .java (and references to it) and run the following command, everything works great (all code is generated, no errors):
D:\software\haikuvm132\bin\haiku.bat -v --Config arduinoIDE F:\workspace\adxl35\src\com\pp\Blink.java
If I have Wire.java and references to it, and run the above command, the compilation step fails since the Wire.java is not passed to javac. I won't post the full trace here, but here's one of the errors:
symbol: variable Wire
location: class Blink
F:\workspace\adxl35\src\com\pp\Blink.java:98: error: cannot find symbol
Wire.endTransmission(); // false / don't release device /
^
What switches do I need to use on the haiku.bat command for it to do the right thing? I'm using the latest release (1.3.2)
Thanks!
Supporting multiple Java files is really no problem for HaikuVM (to be precise: is no problem for javac).
In your case, all you have to do is, set the classpath (which is passed to javac) to your project source like this:
But, I do have to admit that my documentation is not very explicit on this. (Just a small hint in my FAQs: "Q: Is it possible to compile against a JAR library with HaikuVM?")
The default classpath of HaikuVM is (as defined in './bin/makeclasses.mk'):
You may prepend to this default classpath with your <javaclasspath> given with the option --classpath <javaclasspath>.
Thank you for your feedback. I will improve the documentation soon.
BTW, did you try 'arduinoIDEUpload' instead of 'arduinoIDE'?
Last edit: genom2 2015-06-08
Thanks, Bob. I'll try this.
Yes, I did try arduinoIDEUpload, and got an error. The error is very cryptic. I'll start a separate post to discuss that so we keep this post clean.
Thanks again!
Another solution is to escape the quotes on the command line. So, for instance,
D:\software\haikuvm132\bin\haiku.bat -v --Config arduinoIDE --classpath "F:\runtime-EclipseApplication\asdf\lib\myLib.jar;F:\runtime-EclipseApplication\asdf\bin;" F:\runtime-EclipseApplication(1)\asdf\src\asdf\trial.java
, do this:
D:\software\haikuvm132\bin\haiku.bat -v --Config arduinoIDE --classpath \"F:\runtime-EclipseApplication\asdf\lib\myLib.jar;F:\runtime-EclipseApplication\asdf\bin;\" F:\runtime-EclipseApplication(1)\asdf\src\asdf\trial.java
No batch file change required with this approach. Should be added to the documentation though.