diff -Naur libreoffice-7.6.0.3.orig/cui/source/options/optjava.cxx libreoffice-7.6.0.3/cui/source/options/optjava.cxx
--- libreoffice-7.6.0.3.orig/cui/source/options/optjava.cxx	2023-08-08 15:49:18.000000000 -0400
+++ libreoffice-7.6.0.3/cui/source/options/optjava.cxx	2023-08-21 12:38:20.652657824 -0400
@@ -937,6 +937,7 @@
 
 void SvxJavaClassPathDlg::SetClassPath( const OUString& _rPath )
 {
+#if HAVE_FEATURE_JAVA
     if ( m_sOldPath.isEmpty() )
         m_sOldPath = _rPath;
     m_xPathList->clear();
@@ -962,6 +963,7 @@
         m_xPathList->select(0);
     }
     SelectHdl_Impl(*m_xPathList);
+#endif
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
