4

I need to recompile java applicattion, written on Java 8. App use com.sun.javafx.collections.ObservableListWrapper class, but when compiling for java 9 error occurs:

Error:(3, 22) java: package com.sun.javafx.collections is not visible
  (package com.sun.javafx.collections is declared in module javafx.base,     which does not export it to the unnamed module)

Which class I can use instead of ObservableListWrapper? Or how to bypass this problem?

fabian
  • 80,457
  • 12
  • 86
  • 114
Alex T
  • 2,067
  • 4
  • 20
  • 27

2 Answers2

8

Since Java9, most of the com.sun.* APIs are unsupported, JDK-internal APIs and they might go away at any time. Also as described in the noteworthy column -

You should plan to move to using the javafx.collections.FXCollections instead.

Naman
  • 27,789
  • 26
  • 218
  • 353
1

Use exposed class since Java 8: ModifiableObservableListBase.

That should handle all your needs.

anothernode
  • 5,100
  • 13
  • 43
  • 62
ghostNet
  • 41
  • 4