Hey ,
I am working on a project that involves porting a java program on arduino. The problem is that I am new to all of this. So i have a question. Is it possible to compile more than one java program on HaikuVM and upload the hex to arduino ? Also i was thinking is it possible to compile .jar files using Haiku ? Any help / suggestions would be appreciated.
Thanks in advance
Cache
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hey Bob ,
Thanks for the info !! My other quesstion is how to compile a java fn which calls a .jar file in haiku. Will the compiler be able to also compile the .jar file and convert it into .hex file for me to upload into Arduino ? Please do enlighten me ! Also please tell me if I am not clear with my question !
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I found a non elegant solution to include a JAR file. This is how it works:
1) put your JAR file (let's call it 'mylib.jar') into ./lib/nxt.
2) Patch file ./bin/makeclasses.mk from:
...main\java;$(NXJ_HOME)\lib\nxt\classes.jar;$(NXJ_HOME)\bootstrap\src...
into
...main\java;$(NXJ_HOME)\lib\nxt\classes.jar;$(NXJ_HOME)\lib\nxt\mylib.jar;$(NXJ_HOME)\bootstrap\src...
As said, it's not elegant (but it works). So I will offer a more elegant solution in the next release of HaikuVM, comming soon.
I hope this is of some (intermediate) help.
Kind regards
Bob Genom
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello Bob ,
Thank you for taking time and helping me sort the issue with this workaround. I have not yet tried this. I will try it and tell you how it goes. definitely this is of great help to me !!
Thanks
Cache
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hey ,
I am working on a project that involves porting a java program on arduino. The problem is that I am new to all of this. So i have a question. Is it possible to compile more than one java program on HaikuVM and upload the hex to arduino ? Also i was thinking is it possible to compile .jar files using Haiku ? Any help / suggestions would be appreciated.
Thanks in advance
Cache
Compiling more than one Java program into one (third) program is not a question of HaikuVM but of Java programming. Consider this:
and this:
Both can be called from within this:
Hope this is of some help.
Kind regards
Bob Genom
Hey Bob ,
Thanks for the info !! My other quesstion is how to compile a java fn which calls a .jar file in haiku. Will the compiler be able to also compile the .jar file and convert it into .hex file for me to upload into Arduino ? Please do enlighten me ! Also please tell me if I am not clear with my question !
Hello Cache,
I found a non elegant solution to include a JAR file. This is how it works:
1) put your JAR file (let's call it 'mylib.jar') into ./lib/nxt.
2) Patch file ./bin/makeclasses.mk from:
...main\java;$(NXJ_HOME)\lib\nxt\classes.jar;$(NXJ_HOME)\bootstrap\src...
into
...main\java;$(NXJ_HOME)\lib\nxt\classes.jar;$(NXJ_HOME)\lib\nxt\mylib.jar;$(NXJ_HOME)\bootstrap\src...
As said, it's not elegant (but it works). So I will offer a more elegant solution in the next release of HaikuVM, comming soon.
I hope this is of some (intermediate) help.
Kind regards
Bob Genom
Hello Bob ,
Thank you for taking time and helping me sort the issue with this workaround. I have not yet tried this. I will try it and tell you how it goes. definitely this is of great help to me !!
Thanks
Cache