diff --git a/share/qtcreator/qml/qmlobserver/main.cpp b/share/qtcreator/qml/qmlobserver/main.cpp
index 464b6a83a8a6354b9f69afa21db76623e3b428e8..5189a70872c1eaadfedfdc0beca379c6224e1789 100644
--- a/share/qtcreator/qml/qmlobserver/main.cpp
+++ b/share/qtcreator/qml/qmlobserver/main.cpp
@@ -362,8 +362,10 @@ int main(int argc, char ** argv)
     if (stayOnTop)
         wflags |= Qt::WindowStaysOnTopHint;
 
+#if defined(QMLJSDEBUGGER)
     // enable remote debugging
     QDeclarativeDebugHelper::enableDebugging();
+#endif
 
     QDeclarativeViewer *viewer = new QDeclarativeViewer(0, wflags);
     viewer->setAttribute(Qt::WA_DeleteOnClose, true);