我目前正在尝试将我们的应用程序从Java 8迁移到Java 10,并在几个月后将迁移到Java 11。
我们有一个遗留系统,它使用了一些API,我猜它们将被删除或将被删除。我们正在使用ant脚本(1.10.1)进行应用程序编译。
以下是构建我们的应用程序的部分:
在编译期间,移至Java 10后,与Java Swing相关的错误很少(还是较旧的错误,但必须忍受)。由于我仍不完全了解Java
10中发生的所有更改,因此我认为就像这个问题与模块化概念有关。不确定虽然仍在学习。我知道您的建议是要知道这些错误是否与模块化有关。还有解决这些的建议或技巧吗?
下面是错误:
[javac] Compiling 3253 source files to C:\WorkSpace\JAVA10\oswm\rel20.10_Patches\WorkManager\classes
[javac] C:\WorkSpace\JAVA10\oswm\rel20.10_Patches\WorkManager\src\com\osm\datamgmt\report\ui\AssignPosNumberToolbar.java:26: error: package com.sun.java.swing.plaf.windows is not visible
[javac] import com.sun.java.swing.plaf.windows.WindowsButtonUI;
[javac] ^
[javac] (package com.sun.java.swing.plaf.windows is declared in module java.desktop, which does not export it)
[javac] C:\WorkSpace\JAVA10\oswm\rel20.10_Patches\WorkManager\src\com\osm\datamgmt\report\ui\AssignPosNumberToolbar.java:27: error: package com.sun.java.swing.plaf.windows is not visible
[javac] import com.sun.java.swing.plaf.windows.WindowsToolBarUI;
[javac] ^
[javac] (package com.sun.java.swing.plaf.windows is declared in module java.desktop, which does not export it)
[javac] C:\WorkSpace\JAVA10\oswm\rel20.10_Patches\WorkManager\src\com\osm\ui\utils\WMClosableTabbedPane.java:33: error: package com.sun.java.swing.plaf.windows is not visible
[javac] import com.sun.java.swing.plaf.windows.WindowsTabbedPaneUI;
[javac] ^
[javac] (package com.sun.java.swing.plaf.windows is declared in module java.desktop, which does not export it)
[javac] C:\WorkSpace\JAVA10\oswm\rel20.10_Patches\WorkManager\src\com\osm\ui\MultiColumnComboBox.java:58: error: package com.sun.java.swing.plaf.motif is not visible
[javac] import com.sun.java.swing.plaf.motif.MotifComboBoxUI;
[javac] ^
[javac] (package com.sun.java.swing.plaf.motif is declared in module java.desktop, which does not export it)
[javac] C:\WorkSpace\JAVA10\oswm\rel20.10_Patches\WorkManager\src\com\osm\datamgmt\ui\SimplificationComboBox.java:31: error: package com.sun.java.swing.plaf.motif is not visible
[javac] import com.sun.java.swing.plaf.motif.MotifComboBoxUI;
[javac] ^
[javac] (package com.sun.java.swing.plaf.motif is declared in module java.desktop, which does not export it)
[javac] C:\WorkSpace\JAVA10\oswm\rel20.10_Patches\WorkManager\src\com\osm\ui\laf\xplookandfeel\XPComboBoxUI.java:21: error: package com.sun.java.swing.plaf.windows is not visible
[javac] import com.sun.java.swing.plaf.windows.WindowsComboBoxUI;
[javac] ^
[javac] (package com.sun.java.swing.plaf.windows is declared in module java.desktop, which does not export it)
[javac] C:\WorkSpace\JAVA10\oswm\rel20.10_Patches\WorkManager\src\com\osm\datamgmt\ui\favorites\FavoritesToolBar.java:28: error: package com.sun.java.swing.plaf.windows is not visible
[javac] import com.sun.java.swing.plaf.windows.WindowsButtonUI;
[javac] ^
[javac] (package com.sun.java.swing.plaf.windows is declared in module java.desktop, which does not export it)
[javac] C:\WorkSpace\JAVA10\oswm\rel20.10_Patches\WorkManager\src\com\osm\datamgmt\ui\favorites\FavoritesToolBar.java:29: error: package com.sun.java.swing.plaf.windows is not visible
[javac] import com.sun.java.swing.plaf.windows.WindowsToolBarUI;
[javac] ^
[javac] (package com.sun.java.swing.plaf.windows is declared in module java.desktop, which does not export it)
[javac] C:\WorkSpace\JAVA10\oswm\rel20.10_Patches\WorkManager\src\com\osm\ui\laf\ptc\PtcLaf.java:14: error: package com.sun.java.swing.plaf.windows is not visible
[javac] import com.sun.java.swing.plaf.windows.WindowsLookAndFeel;
[javac] ^
[javac] (package com.sun.java.swing.plaf.windows is declared in module java.desktop, which does not export it)
[javac] C:\WorkSpace\JAVA10\oswm\rel20.10_Patches\WorkManager\src\com\osm\ui\laf\ptc\PtcMenuUI.java:31: error: package com.sun.java.swing.plaf.windows is not visible
[javac] import com.sun.java.swing.plaf.windows.WindowsLookAndFeel;
[javac] ^
[javac] (package com.sun.java.swing.plaf.windows is declared in module java.desktop, which does not export it)
[javac] C:\WorkSpace\JAVA10\oswm\rel20.10_Patches\WorkManager\src\com\osm\ui\laf\ptc\PtcRadioButtonMenuItemUI.java:14: error: package com.sun.java.swing.plaf.windows is not visible
[javac] import com.sun.java.swing.plaf.windows.WindowsIconFactory;
[javac] ^
[javac] (package com.sun.java.swing.plaf.windows is declared in module java.desktop, which does not export it)
[javac] C:\WorkSpace\JAVA10\oswm\rel20.10_Patches\WorkManager\src\com\osm\ui\laf\ptc\PtcSeparatorUI.java:20: error: package com.sun.java.swing.plaf.windows is not visible
[javac] import com.sun.java.swing.plaf.windows.WindowsSeparatorUI;
[javac] ^
[javac] (package com.sun.java.swing.plaf.windows is declared in module java.desktop, which does not export it)
[javac] C:\WorkSpace\JAVA10\oswm\rel20.10_Patches\WorkManager\src\com\osm\ui\laf\xplookandfeel\XPButtonUI.java:26: error: package com.sun.java.swing.plaf.windows is not visible
[javac] import com.sun.java.swing.plaf.windows.WindowsButtonUI;
[javac] ^
[javac] (package com.sun.java.swing.plaf.windows is declared in module java.desktop, which does not export it)
[javac] C:\WorkSpace\JAVA10\oswm\rel20.10_Patches\WorkManager\src\com\osm\ui\laf\xplookandfeel\XPLookAndFeel.java:24: error: package com.sun.java.swing.plaf.windows is not visible
[javac] import com.sun.java.swing.plaf.windows.WindowsIconFactory;
[javac] ^
[javac] (package com.sun.java.swing.plaf.windows is declared in module java.desktop, which does not export it)
[javac] C:\WorkSpace\JAVA10\oswm\rel20.10_Patches\WorkManager\src\com\osm\ui\laf\xplookandfeel\XPLookAndFeel.java:25: error: package com.sun.java.swing.plaf.windows is not visible
[javac] import com.sun.java.swing.plaf.windows.WindowsLookAndFeel;
[javac] ^
[javac] (package com.sun.java.swing.plaf.windows is declared in module java.desktop, which does not export it)
[javac] C:\WorkSpace\JAVA10\oswm\rel20.10_Patches\WorkManager\src\com\osm\ui\laf\xplookandfeel\XPMenuUI.java:25: error: package com.sun.java.swing.plaf.windows is not visible
[javac] import com.sun.java.swing.plaf.windows.WindowsLookAndFeel;
[javac] ^
[javac] (package com.sun.java.swing.plaf.windows is declared in module java.desktop, which does not export it)
[javac] C:\WorkSpace\JAVA10\oswm\rel20.10_Patches\WorkManager\src\com\osm\ui\laf\xplookandfeel\XPRadioButtonMenuItemUI.java:14: error: package com.sun.java.swing.plaf.windows is not visible
[javac] import com.sun.java.swing.plaf.windows.WindowsIconFactory;
[javac] ^
[javac] (package com.sun.java.swing.plaf.windows is declared in module java.desktop, which does not export it)
[javac] C:\WorkSpace\JAVA10\oswm\rel20.10_Patches\WorkManager\src\com\osm\ui\laf\xplookandfeel\XPSeparatorUI.java:17: error: package com.sun.java.swing.plaf.windows is not visible
[javac] import com.sun.java.swing.plaf.windows.WindowsSeparatorUI;
[javac] ^
[javac] (package com.sun.java.swing.plaf.windows is declared in module java.desktop, which does not export it)
[javac] C:\WorkSpace\JAVA10\oswm\rel20.10_Patches\WorkManager\src\com\osm\ui\laf\xplookandfeel\XPToggleButtonUI.java:23: error: package com.sun.java.swing.plaf.windows is not visible
[javac] import com.sun.java.swing.plaf.windows.WindowsToggleButtonUI;
[javac] ^
[javac] (package com.sun.java.swing.plaf.windows is declared in module java.desktop, which does not export it)
[javac] C:\WorkSpace\JAVA10\oswm\rel20.10_Patches\WorkManager\src\com\osm\ui\laf\xplookandfeel\XPToolBarUI.java:17: error: package com.sun.java.swing.plaf.windows is not visible
[javac] import com.sun.java.swing.plaf.windows.WindowsToolBarUI;
[javac] ^
[javac] (package com.sun.java.swing.plaf.windows is declared in module java.desktop, which does not export it)
[javac] 20 errors