diff --git a/dune/elasticity/materials/localintegralenergy.hh b/dune/elasticity/materials/localintegralenergy.hh
index 6ef381539d8163f6409229c65dcd72631591587d..9acc5c0ef105b679455b673fd3cb7d19c87d0735 100644
--- a/dune/elasticity/materials/localintegralenergy.hh
+++ b/dune/elasticity/materials/localintegralenergy.hh
@@ -2,7 +2,10 @@
 #define DUNE_ELASTICITY_MATERIALS_LOCALINTEGRALENERGY_HH
 
 #include <dune/common/fmatrix.hh>
+#include <dune/common/version.hh>
+#if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 8)
 #include <dune/common/transpose.hh>
+#endif
 
 #include <dune/geometry/quadraturerules.hh>
 
@@ -77,7 +80,14 @@ energy(const LocalView& localView,
 
     // compute gradients of base functions
     for (size_t i=0; i<jacobians.size(); ++i)
+#if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 8)
       jacobians[i] = jacobians[i] * transpose(geometryJacobianIT);
+#else
+    {
+      auto referenceJacobian = jacobians[i];
+      geometryJacobianIT.mv(referenceJacobian[0], jacobians[i][0]);
+    }
+#endif
 
     // Deformation gradient
     FieldMatrix<field_type,gridDim,gridDim> deformationGradient(0);