1 /*
2 * Copyright (c) 1994, 2013, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
191
192 putID = (*env)->GetMethodID(env,
193 (*env)->GetObjectClass(env, props),
194 "put",
195 "(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;");
196 CHECK_NULL_RETURN(putID, NULL);
197
198 removeID = (*env)->GetMethodID(env,
199 (*env)->GetObjectClass(env, props),
200 "remove",
201 "(Ljava/lang/Object;)Ljava/lang/Object;");
202 CHECK_NULL_RETURN(removeID, NULL);
203
204 getPropID = (*env)->GetMethodID(env,
205 (*env)->GetObjectClass(env, props),
206 "getProperty",
207 "(Ljava/lang/String;)Ljava/lang/String;");
208 CHECK_NULL_RETURN(getPropID, NULL);
209
210 PUTPROP(props, "java.specification.version",
211 JDK_MAJOR_VERSION "." JDK_MINOR_VERSION);
212 PUTPROP(props, "java.specification.name",
213 "Java Platform API Specification");
214 PUTPROP(props, "java.specification.vendor",
215 JAVA_SPECIFICATION_VENDOR);
216
217 PUTPROP(props, "java.version", RELEASE);
218 PUTPROP(props, "java.vendor", VENDOR);
219 PUTPROP(props, "java.vendor.url", VENDOR_URL);
220 PUTPROP(props, "java.vendor.url.bug", VENDOR_URL_BUG);
221
222 jio_snprintf(buf, sizeof(buf), "%d.%d", JAVA_MAX_SUPPORTED_VERSION,
223 JAVA_MAX_SUPPORTED_MINOR_VERSION);
224 PUTPROP(props, "java.class.version", buf);
225
226 if (sprops->awt_toolkit) {
227 PUTPROP(props, "awt.toolkit", sprops->awt_toolkit);
228 }
229 #ifdef MACOSX
230 if (sprops->awt_headless) {
231 PUTPROP(props, "java.awt.headless", sprops->awt_headless);
232 }
233 #endif
234
235 /* os properties */
236 PUTPROP(props, "os.name", sprops->os_name);
237 PUTPROP(props, "os.version", sprops->os_version);
|
1 /*
2 * Copyright (c) 1994, 2015, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
191
192 putID = (*env)->GetMethodID(env,
193 (*env)->GetObjectClass(env, props),
194 "put",
195 "(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;");
196 CHECK_NULL_RETURN(putID, NULL);
197
198 removeID = (*env)->GetMethodID(env,
199 (*env)->GetObjectClass(env, props),
200 "remove",
201 "(Ljava/lang/Object;)Ljava/lang/Object;");
202 CHECK_NULL_RETURN(removeID, NULL);
203
204 getPropID = (*env)->GetMethodID(env,
205 (*env)->GetObjectClass(env, props),
206 "getProperty",
207 "(Ljava/lang/String;)Ljava/lang/String;");
208 CHECK_NULL_RETURN(getPropID, NULL);
209
210 PUTPROP(props, "java.specification.version",
211 VERSION_SPECIFICATION);
212 PUTPROP(props, "java.specification.name",
213 "Java Platform API Specification");
214 PUTPROP(props, "java.specification.vendor",
215 JAVA_SPECIFICATION_VENDOR);
216
217 PUTPROP(props, "java.version", VERSION_SHORT);
218 PUTPROP(props, "java.vendor", VENDOR);
219 PUTPROP(props, "java.vendor.url", VENDOR_URL);
220 PUTPROP(props, "java.vendor.url.bug", VENDOR_URL_BUG);
221
222 jio_snprintf(buf, sizeof(buf), "%d.%d", JAVA_MAX_SUPPORTED_VERSION,
223 JAVA_MAX_SUPPORTED_MINOR_VERSION);
224 PUTPROP(props, "java.class.version", buf);
225
226 if (sprops->awt_toolkit) {
227 PUTPROP(props, "awt.toolkit", sprops->awt_toolkit);
228 }
229 #ifdef MACOSX
230 if (sprops->awt_headless) {
231 PUTPROP(props, "java.awt.headless", sprops->awt_headless);
232 }
233 #endif
234
235 /* os properties */
236 PUTPROP(props, "os.name", sprops->os_name);
237 PUTPROP(props, "os.version", sprops->os_version);
|