< prev index next >

src/java.base/windows/native/libjli/java_md.c

Print this page


   1 /*
   2  * Copyright (c) 1997, 2016, 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


 141 #endif /* ENABLE_AWT_PRELOAD */
 142 
 143 
 144 static jboolean _isjavaw = JNI_FALSE;
 145 
 146 
 147 jboolean
 148 IsJavaw()
 149 {
 150     return _isjavaw;
 151 }
 152 
 153 /*
 154  *
 155  */
 156 void
 157 CreateExecutionEnvironment(int *pargc, char ***pargv,
 158                            char *jrepath, jint so_jrepath,
 159                            char *jvmpath, jint so_jvmpath,
 160                            char *jvmcfg,  jint so_jvmcfg) {
 161     char * jvmtype;
 162     int i = 0;
 163     int running = CURRENT_DATA_MODEL;
 164 
 165     int wanted = running;
 166 
 167     char** argv = *pargv;
 168     for (i = 1; i < *pargc ; i++) {
 169         if (JLI_StrCmp(argv[i], "-J-d64") == 0 || JLI_StrCmp(argv[i], "-d64") == 0) {
 170             wanted = 64;
 171             continue;
 172         }
 173         if (JLI_StrCmp(argv[i], "-J-d32") == 0 || JLI_StrCmp(argv[i], "-d32") == 0) {
 174             wanted = 32;
 175             continue;
 176         }
 177 
 178         if (IsJavaArgs() && argv[i][0] != '-')
 179             continue;
 180         if (argv[i][0] != '-')
 181             break;
 182     }
 183     if (running != wanted) {
 184         JLI_ReportErrorMessage(JRE_ERROR2, wanted);
 185         exit(1);
 186     }
 187 
 188     /* Find out where the JRE is that we will be using. */
 189     if (!GetJREPath(jrepath, so_jrepath)) {
 190         JLI_ReportErrorMessage(JRE_ERROR1);
 191         exit(2);
 192     }
 193 
 194     JLI_Snprintf(jvmcfg, so_jvmcfg, "%s%slib%sjvm.cfg",
 195         jrepath, FILESEP, FILESEP);
 196 
 197     /* Find the specified JVM type */
 198     if (ReadKnownVMs(jvmcfg, JNI_FALSE) < 1) {
 199         JLI_ReportErrorMessage(CFG_ERROR7);
 200         exit(1);
 201     }
 202 
 203     jvmtype = CheckJvmType(pargc, pargv, JNI_FALSE);
 204     if (JLI_StrCmp(jvmtype, "ERROR") == 0) {
 205         JLI_ReportErrorMessage(CFG_ERROR9);
 206         exit(4);
 207     }


   1 /*
   2  * Copyright (c) 1997, 2017, 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


 141 #endif /* ENABLE_AWT_PRELOAD */
 142 
 143 
 144 static jboolean _isjavaw = JNI_FALSE;
 145 
 146 
 147 jboolean
 148 IsJavaw()
 149 {
 150     return _isjavaw;
 151 }
 152 
 153 /*
 154  *
 155  */
 156 void
 157 CreateExecutionEnvironment(int *pargc, char ***pargv,
 158                            char *jrepath, jint so_jrepath,
 159                            char *jvmpath, jint so_jvmpath,
 160                            char *jvmcfg,  jint so_jvmcfg) {



 161 
 162     char *jvmtype;
 163     int i = 0;
 164     char** argv = *pargv;









 165 










 166     /* Find out where the JRE is that we will be using. */
 167     if (!GetJREPath(jrepath, so_jrepath)) {
 168         JLI_ReportErrorMessage(JRE_ERROR1);
 169         exit(2);
 170     }
 171 
 172     JLI_Snprintf(jvmcfg, so_jvmcfg, "%s%slib%sjvm.cfg",
 173         jrepath, FILESEP, FILESEP);
 174 
 175     /* Find the specified JVM type */
 176     if (ReadKnownVMs(jvmcfg, JNI_FALSE) < 1) {
 177         JLI_ReportErrorMessage(CFG_ERROR7);
 178         exit(1);
 179     }
 180 
 181     jvmtype = CheckJvmType(pargc, pargv, JNI_FALSE);
 182     if (JLI_StrCmp(jvmtype, "ERROR") == 0) {
 183         JLI_ReportErrorMessage(CFG_ERROR9);
 184         exit(4);
 185     }


< prev index next >