A construction machine comprising: a plurality of closed circuit pumps (35, 36); a plurality of hydraulic actuators (1, 3); a plurality of operation levers (34a, 34b) corresponding to the plurality of hydraulic actuators (1, 3); a plurality of switching valves capable of connecting each of the plurality of closed circuit pumps (35, 36) to one of the plurality of hydraulic actuators (1, 3) by closed circuit connection; and a machine body controller that performs open-close control of the plurality of switching valves and flow-rate control of the plurality of closed circuit pumps (35, 36) in response to an operation of the plurality of operation levers (34a, 34b); characterized in that the construction machine comprises: a first sensor (37d, 38d, 39d, 40d) that detects open-closed states of the plurality of switching valves; a first compulsory valve closing device (50, 51) that changes over the plurality of switching valves to a closed position irrespective of the open-close control by the machine body controller; and a valve device controller that is configured to, when detecting based on the open-closed states of the plurality of switching valves that one selector valve of the plurality of switching valves is sticked at an open position against a command by the machine body controller, control the first compulsory valve closing device (50, 51) such that other switching valves except the one selector valve, the other switching valves being connected to one closed circuit pump of the plurality of closed circuit pumps (35, 36), the one closed circuit pump being connected to the one selector valve, are closed. a plurality of closed circuit pumps (35, 36); a plurality of hydraulic actuators (1, 3); a plurality of operation levers (34a, 34b) corresponding to the plurality of hydraulic actuators (1, 3); a plurality of switching valves capable of connecting each of the plurality of closed circuit pumps (35, 36) to one of the plurality of hydraulic actuators (1, 3) by closed circuit connection; and a machine body controller that performs open-close control of the plurality of switching valves and flow-rate control of the plurality of closed circuit pumps (35, 36) in response to an operation of the plurality of operation levers (34a, 34b); characterized in that the construction machine comprises: a first sensor (37d, 38d, 39d, 40d) that detects open-closed states of the plurality of switching valves; a first compulsory valve closing device (50, 51) that changes over the plurality of switching valves to a closed position irrespective of the open-close control by the machine body controller; and a valve device controller that is configured to, when detecting based on the open-closed states of the plurality of switching valves that one selector valve of the plurality of switching valves is sticked at an open position against a command by the machine body controller, control the first compulsory valve closing device (50, 51) such that other switching valves except the one selector valve, the other switching valves being connected to one closed circuit pump of the plurality of closed circuit pumps (35, 36), the one closed circuit pump being connected to the one selector valve, are closed. a first sensor (37d, 38d, 39d, 40d) that detects open-closed states of the plurality of switching valves; a first compulsory valve closing device (50, 51) that changes over the plurality of switching valves to a closed position irrespective of the open-close control by the machine body controller; and a valve device controller that is configured to, when detecting based on the open-closed states of the plurality of switching valves that one selector valve of the plurality of switching valves is sticked at an open position against a command by the machine body controller, control the first compulsory valve closing device (50, 51) such that other switching valves except the one selector valve, the other switching valves being connected to one closed circuit pump of the plurality of closed circuit pumps (35, 36), the one closed circuit pump being connected to the one selector valve, are closed.