diff --git a/src/Plugin/CKEditorPlugin/CkeditorTableToolsToolbar.php b/src/Plugin/CKEditorPlugin/CkeditorTableToolsToolbar.php
index ac35e1d..e9bdf3d 100644
--- a/src/Plugin/CKEditorPlugin/CkeditorTableToolsToolbar.php
+++ b/src/Plugin/CKEditorPlugin/CkeditorTableToolsToolbar.php
@@ -5,6 +5,9 @@ namespace Drupal\ckeditor_tabletoolstoolbar\Plugin\CKEditorPlugin;
 use Drupal\ckeditor\CKEditorPluginBase;
 use Drupal\editor\Entity\Editor;
 
+define('TABLETOOLSTOOLBAR_LIBRARY_PATH', 'libraries/tabletoolstoolbar/plugin.js');
+define('TABLETOOLSTOOLBAR_CKEDITOR_PATH', 'libraries/ckeditor/plugins/tabletoolstoolbar/plugin.js');
+
 /**
  * Defines the "Table Tools Toolbar" plugin.
  *
@@ -19,7 +22,7 @@ class CkeditorTableToolsToolbar extends CKEditorPluginBase {
    * {@inheritdoc}
    */
   public function getFile() {
-    return $this->getPluginPath() . '/plugin.js';
+    return $this->getPluginPath();
   }
 
   /**
@@ -33,78 +36,79 @@ class CkeditorTableToolsToolbar extends CKEditorPluginBase {
    * {@inheritdoc}
    */
   public function getButtons() {
+    $plugin_path = dirname($this->getPluginPath());
     return [
       'tableinsert' => [
         'label' => $this->t('Add new table'),
-        'image' => $this->getPluginPath() . '/icons/tableinsert.png',
+        'image' => $plugin_path . '/icons/tableinsert.png',
       ],
       'tabledelete' => [
         'label' => $this->t('Delete current table'),
-        'image' => $this->getPluginPath() . '/icons/tabledelete.png',
+        'image' => $plugin_path . '/icons/tabledelete.png',
       ],
       'tableproperties' => [
         'label' => $this->t('Show dialog with table properties'),
-        'image' => $this->getPluginPath() . '/icons/tableproperties.png',
+        'image' => $plugin_path . '/icons/tableproperties.png',
       ],
       'tablerowinsertbefore' => [
         'label' => $this->t('Add row above current cell'),
-        'image' => $this->getPluginPath() . '/icons/tablerowinsertbefore.png',
+        'image' => $plugin_path . '/icons/tablerowinsertbefore.png',
       ],
       'tablerowinsertafter' => [
         'label' => $this->t('Add row under current cell'),
-        'image' => $this->getPluginPath() . '/icons/tablerowinsertafter.png',
+        'image' => $plugin_path . '/icons/tablerowinsertafter.png',
       ],
       'tablerowdelete' => [
         'label' => $this->t('Delete row with current cell'),
-        'image' => $this->getPluginPath() . '/icons/tablerowdelete.png',
+        'image' => $plugin_path . '/icons/tablerowdelete.png',
       ],
       'tablecolumninsertbefore' => [
         'label' => $this->t('Add column before current cell'),
-        'image' => $this->getPluginPath() . '/icons/tablecolumninsertbefore.png',
+        'image' => $plugin_path . '/icons/tablecolumninsertbefore.png',
       ],
       'tablecolumninsertafter' => [
         'label' => $this->t('Add column after current cell'),
-        'image' => $this->getPluginPath() . '/icons/tablecolumninsertafter.png',
+        'image' => $plugin_path . '/icons/tablecolumninsertafter.png',
       ],
       'tablecolumndelete' => [
         'label' => $this->t('Delete column with current cell'),
-        'image' => $this->getPluginPath() . '/icons/tablecolumndelete.png',
+        'image' => $plugin_path . '/icons/tablecolumndelete.png',
       ],
       'tablecellinsertbefore' => [
         'label' => $this->t('Add cell before current cell'),
-        'image' => $this->getPluginPath() . '/icons/tablecellinsertbefore.png',
+        'image' => $plugin_path . '/icons/tablecellinsertbefore.png',
       ],
       'tablecellinsertafter' => [
         'label' => $this->t('Add cell after current cell'),
-        'image' => $this->getPluginPath() . '/icons/tablecellinsertafter.png',
+        'image' => $plugin_path . '/icons/tablecellinsertafter.png',
       ],
       'tablecelldelete' => [
         'label' => $this->t('Delete current cell'),
-        'image' => $this->getPluginPath() . '/icons/tablecelldelete.png',
+        'image' => $plugin_path . '/icons/tablecelldelete.png',
       ],
       'tablecellproperties' => [
         'label' => $this->t('Show dialog with current cell properties'),
-        'image' => $this->getPluginPath() . '/icons/tablecellproperties.png',
+        'image' => $plugin_path . '/icons/tablecellproperties.png',
       ],
       'tablecellsmerge' => [
         'label' => $this->t('Merge selected cells'),
-        'image' => $this->getPluginPath() . '/icons/tablecellsmerge.png',
+        'image' => $plugin_path . '/icons/tablecellsmerge.png',
       ],
       'tablecellmergeright' => [
         'label' => $this->t('Merge current cell with right cell'),
-        'image' => $this->getPluginPath() . '/icons/tablecellmergeright.png',
+        'image' => $plugin_path . '/icons/tablecellmergeright.png',
       ],
       'tablecellmergedown' => [
         'label' => $this->t('Merge current cell with down cell'),
-        'image' => $this->getPluginPath() . '/icons/tablecellmergedown.png',
+        'image' => $plugin_path . '/icons/tablecellmergedown.png',
       ],
       'tablecellsplithorizontal' => [
         'label' => $this->t('Split horizontal current cell'),
-        'image' => $this->getPluginPath() . '/icons/tablecellsplithorizontal.png',
+        'image' => $plugin_path . '/icons/tablecellsplithorizontal.png',
       ],
       'tablecellsplitvertical' => [
         'label' => $this->t('Split vertical current cell'),
-        'image' => $this->getPluginPath() . '/icons/tablecellsplitvertical.png',
+        'image' => $plugin_path . '/icons/tablecellsplitvertical.png',
       ],
     ];
   }
@@ -122,8 +126,30 @@ class CkeditorTableToolsToolbar extends CKEditorPluginBase {
    * @return string
    *   Relative path to the ckeditor plugin folder
    */
-  private function getPluginPath() {
-    return 'libraries/tabletoolstoolbar';
+  protected function getPluginPath() {
+    // Support for "Libraries API" module.
+    if (\Drupal::moduleHandler()->moduleExists('libraries')) {
+      return libraries_get_path('tabletoolstoolbar');
+    }
+
+    $profile_path = drupal_get_path('profile', \Drupal::installProfile());
+
+    foreach ([TABLETOOLSTOOLBAR_LIBRARY_PATH, TABLETOOLSTOOLBAR_CKEDITOR_PATH] as $derivative) {
+      $path = DRUPAL_ROOT . DIRECTORY_SEPARATOR . $derivative;
+      if (file_exists($path)) {
+        return $derivative;
+      }
+
+      // If plugin is not found, then look in the current profile libraries
+      // path.
+      $profile_path .= DIRECTORY_SEPARATOR . $derivative;
+      // Is the library found in the current profile libraries path.
+      if (file_exists($profile_path)) {
+        return $profile_path;
+      }
+    }
+
+    throw new \Exception('Could not find the "Table Tools Toolbar" ckeditor plugin.');
   }
 
 }
