[Java EE7]GlassFish requires Java SE version 6. Your JDK is version 0の解決方法

現象
GlassFishの管理コンソール上で、[JDBC Connection Pools]を設定する際に下記エラーが表示されます

HTTP Status 500 – Internal Server Error
type Exception report
messageInternal Server Error
descriptionThe server encountered an internal error that prevented it from fulfilling this request.
exception

対策
1.管理者権限でコマンド プロンプトを起動します。

2.cd C:\glassfish-4.1.2\glassfish4\glassfish

3.asadmin create-jdbc-connection-pool –datasourceclassname com.mysql.jdbc.jdbc2.optional.MysqlDataSource –restype javax.sql.DataSource cftSqlPool

4.[GlassFish requires Java SE version 6. Your JDK is version 0]が表示される場合
(1).対象ファイル C:\glassfish-4.1.2\glassfish4\glassfish\config\asenv.bat

(2).追加内容
set AS_JAVA=C:\Program Files\Java\jdk1.8.0_144

(3) glassfishを起動
C:\glassfish-4.1.2\glassfish4\bin>asadmin start-domain
Waiting for domain1 to start ……………………………….
Successfully started the domain : domain1
domain Location: C:\glassfish-4.1.2\glassfish4\glassfish\domains\domain1
Log File: C:\glassfish-4.1.2\glassfish4\glassfish\domains\domain1\logs\server.log
Admin Port: 4848
Command start-domain executed successfully.

Glassfish

Posted by arkgame