I use ant to compile Java project, and there is some javascript code in build.xml. When I run, it failed with 'Unable to create javax script engine for javascript'. My environment is FreeBSD 9.0 + apache-ant-1.8.2 + openjdk1.6.0_30. It seems that a javascript engine need to add to the system, but how to do?
Asked
Active
Viewed 1,671 times
1
-
See [this answer](https://stackoverflow.com/a/71031839/1183010) to find an ant script alternative for Java version 15+ – R. Oosterholt Apr 10 '22 at 13:31
1 Answers
2
It would be nice if you had posted some log output, so this answer is just guesswork and a bit of googling.
According to the docu at https://ant.apache.org/manual/Tasks/script.html you need to install the rhino JavaScript library.
https://ant.apache.org/manual/install.html#librarydependencies has some more information on how to install library dependencies.
You can try to install the FreeBSD rhino port from /usr/ports/lang/rhino

arved
- 4,401
- 4
- 30
- 53
-
yeah, it helps me much. Thank you. But when I installed rhino and run the command 'jrunscript -q', there is yet nothing engine shows. When I run the command in my windows, it shows 'Language ECMAScript 1.6 implemention "Mozilla Rhino" 1.6 release 2'. So I think there should be some other configurations should do. It troubles me. – bitristan Mar 13 '12 at 07:23