def _make_java_command(self): java_home = os.environ.get('JAVA_HOME') if java_home and os.path.exists(java_home): java_bin = os.path.join(java_home, 'bin/java') else: java_bin = 'java' java_lib_dir = os.path.join(java_dir.get_java_dir(), 'lib') assert os.path.isdir(java_lib_dir), java_lib_dir class_path = os.path.join(java_lib_dir, 'appengine-tools-api.jar') assert os.path.isfile(class_path), class_path if self._for_jetty9: jetty_home = os.environ.get('APP_ENGINE_JETTY_HOME', None) jetty_base = os.environ.get('APP_ENGINE_JETTY_BASE', None) if not jetty_home: jetty_home = os.path.join(java_lib_dir, 'java-managed-vm', 'appengine-java-vmruntime') if not jetty_base: jetty_base = os.path.join(java_lib_dir, 'jetty-base-sdk') args = [ java_bin, ('-Dgcloud.java.application=%s' % self._module_configuration.application_root), '-Djetty.home=%s' % jetty_home, '-Djetty.base=%s' % jetty_base, ] args.extend(self._runtime_config_getter().java_config.jvm_args) args.append('-jar') args.append('%s/start.jar' % jetty_home) else: args = [ java_bin, '-cp', class_path, '-Dappengine.sdk.root=' + java_dir.get_java_dir(), '-Dappengine.runtime=' + self._module_configuration.runtime, ] if self._module_configuration.runtime.startswith('java8'): args.append('-Duse_jetty9_runtime=true') if sys.platform == 'darwin': args.append('-XstartOnFirstThread') args.extend(self._runtime_config_getter().java_config.jvm_args) args.append( 'com.google.appengine.tools.development.devappserver2.' 'StandaloneInstance') return args
def _make_java_command(self): java_home = os.environ.get('JAVA_HOME') if java_home and os.path.exists(java_home): java_bin = os.path.join(java_home, 'bin/java') else: java_bin = 'java' java_lib_dir = os.path.join(java_dir.get_java_dir(), 'lib') assert os.path.isdir(java_lib_dir), java_lib_dir class_path = os.path.join(java_lib_dir, 'appengine-tools-api.jar') assert os.path.isfile(class_path), class_path if self._for_jetty9: jetty_home = os.environ.get('APP_ENGINE_JETTY_HOME', None) jetty_base = os.environ.get('APP_ENGINE_JETTY_BASE', None) if not jetty_home: jetty_home = os.path.join(java_lib_dir, 'java-managed-vm', 'appengine-java-vmruntime') if not jetty_base: jetty_base = os.path.join(java_lib_dir, 'jetty-base-sdk') args = [ java_bin, ('-Dgcloud.java.application=%s' % self._module_configuration.application_root), '-Djetty.home=%s' % jetty_home, '-Djetty.base=%s' % jetty_base, ] args.extend(self._runtime_config_getter().java_config.jvm_args) args.append('-jar') args.append('%s/start.jar' % jetty_home) else: args = [ java_bin, '-cp', class_path, '-Dappengine.sdk.root=' + java_dir.get_java_dir(), '-Dappengine.runtime=' + self._module_configuration.runtime, ] if self._module_configuration.runtime.startswith('java8'): args.append('-Duse_jetty9_runtime=true') if sys.platform == 'darwin': args.append('-XstartOnFirstThread') args.extend(self._runtime_config_getter().java_config.jvm_args) args.append('com.google.appengine.tools.development.devappserver2.' 'StandaloneInstance') return args
def java_supported(): """True if this SDK supports running Java apps in the dev appserver.""" return os.path.isdir(java_dir.get_java_dir())
def java_supported(): """True if this SDK supports running Java apps in the dev appserver.""" return os.path.isdir(java_dir.get_java_dir())