I want to use a java library in a javascript written in ES6. I tried j2v8 and nashorn, but they are not supporting ES6 features. Is there any other way to do the same?
Asked
Active
Viewed 442 times
-1
-
2Use [Babel](https://babeljs.io/) to compile your ES6 code down to ES5, maybe? – Joe Clay Jun 15 '17 at 11:36
-
Do you have to use this Java library? You can try using JS equivalents. – SuperStormer Jun 15 '17 at 23:57
-
@JoeClay I am following this method now – Megha Rao Jun 16 '17 at 07:01
-
@SuperStormer, Yeah.. I have to use this java library – Megha Rao Jun 16 '17 at 07:02
-
Have you looked at Rhino? https://developer.mozilla.org/en-US/docs/Mozilla/Projects/Rhino/Scripting_Java – Woodchuck Aug 28 '18 at 16:27
1 Answers
1
The most recent builds of J2V8 (4.7.1) is built with V8 5.4.500.45. I'm not sure what ES 6 features V8 5.4.500.45, but J2V8 will be "bug for bug" / "feature for feature" compatible with that.
J2V8 is just a wrapper around V8, so it only supports as much or as little as V8 does.

irbull
- 2,490
- 2
- 20
- 28