Added openjdk8-fedora-non-isolated and modified
 openjdk8-zulu-compact* apps to support running java apps in non-isolated mode.

Deleted obsolete java-compact*-example apps.

Example to build an image with isolated JVM:
./scripts/build image=openjdk8-fedora,java-example

Example to build an image with non-isolated JVM:
./scripts/build image=openjdk8-fedora-non-isolated,java-example

Example to build a compact 1 image (only non-isolated JVM supported):
./scripts/build image=openjdk8-zulu-compact1,java-example

Signed-off-by: Waldemar Kozaczuk <jwkozac...@gmail.com>
---
 java-compact1-example/Hello.java                   |  5 ---
 java-compact1-example/Makefile                     |  7 ----
 java-compact1-example/module.py                    |  5 ---
 java-compact1-example/usr.manifest                 |  1 -
 java-compact2-example/Hello.java                   |  5 ---
 java-compact2-example/Makefile                     |  7 ----
 java-compact2-example/module.py                    |  5 ---
 java-compact2-example/usr.manifest                 |  1 -
 java-compact3-example/Hello.java                   |  5 ---
 java-compact3-example/Makefile                     |  7 ----
 java-compact3-example/module.py                    |  5 ---
 java-compact3-example/usr.manifest                 |  1 -
 openjdk8-fedora-non-isolated/Makefile              | 40 ++++++++++++++++++++++
 openjdk8-fedora-non-isolated/latest.sh             |  9 +++++
 .../module.py                                      |  8 +++--
 openjdk8-fedora-non-isolated/usr.manifest          | 20 +++++++++++
 openjdk8-zulu-compact1/module.py                   |  2 ++
 openjdk8-zulu-compact2/module.py                   |  2 ++
 openjdk8-zulu-compact3/module.py                   |  2 ++
 19 files changed, 80 insertions(+), 57 deletions(-)
 delete mode 100644 java-compact1-example/Hello.java
 delete mode 100644 java-compact1-example/Makefile
 delete mode 100644 java-compact1-example/module.py
 delete mode 100644 java-compact1-example/usr.manifest
 delete mode 100644 java-compact2-example/Hello.java
 delete mode 100644 java-compact2-example/Makefile
 delete mode 100644 java-compact2-example/module.py
 delete mode 100644 java-compact2-example/usr.manifest
 delete mode 100644 java-compact3-example/Hello.java
 delete mode 100644 java-compact3-example/Makefile
 delete mode 100644 java-compact3-example/module.py
 delete mode 100644 java-compact3-example/usr.manifest
 create mode 100644 openjdk8-fedora-non-isolated/Makefile
 create mode 100755 openjdk8-fedora-non-isolated/latest.sh
 copy {openjdk8-zulu-compact3 => openjdk8-fedora-non-isolated}/module.py (71%)
 create mode 100644 openjdk8-fedora-non-isolated/usr.manifest

diff --git a/java-compact1-example/Hello.java b/java-compact1-example/Hello.java
deleted file mode 100644
index a605554..0000000
--- a/java-compact1-example/Hello.java
+++ /dev/null
@@ -1,5 +0,0 @@
-public class Hello {
-    public static void main(String[] args) {
-        System.out.println("Hello, World!");
-    }
-}
diff --git a/java-compact1-example/Makefile b/java-compact1-example/Makefile
deleted file mode 100644
index 8a385c9..0000000
--- a/java-compact1-example/Makefile
+++ /dev/null
@@ -1,7 +0,0 @@
-module: Hello.class
-
-%.class: %.java
-       javac -target 7 -source 7 $^
-
-clean:
-       rm -rf *.class
diff --git a/java-compact1-example/module.py b/java-compact1-example/module.py
deleted file mode 100644
index 216cf35..0000000
--- a/java-compact1-example/module.py
+++ /dev/null
@@ -1,5 +0,0 @@
-from osv.modules import api
-
-api.require('openjdk8-zulu-compact1')
-
-default = api.run('/java.so -cp /java-example Hello')
diff --git a/java-compact1-example/usr.manifest 
b/java-compact1-example/usr.manifest
deleted file mode 100644
index f62abc7..0000000
--- a/java-compact1-example/usr.manifest
+++ /dev/null
@@ -1 +0,0 @@
-/java-example/Hello.class: ${MODULE_DIR}/Hello.class
diff --git a/java-compact2-example/Hello.java b/java-compact2-example/Hello.java
deleted file mode 100644
index a605554..0000000
--- a/java-compact2-example/Hello.java
+++ /dev/null
@@ -1,5 +0,0 @@
-public class Hello {
-    public static void main(String[] args) {
-        System.out.println("Hello, World!");
-    }
-}
diff --git a/java-compact2-example/Makefile b/java-compact2-example/Makefile
deleted file mode 100644
index 8a385c9..0000000
--- a/java-compact2-example/Makefile
+++ /dev/null
@@ -1,7 +0,0 @@
-module: Hello.class
-
-%.class: %.java
-       javac -target 7 -source 7 $^
-
-clean:
-       rm -rf *.class
diff --git a/java-compact2-example/module.py b/java-compact2-example/module.py
deleted file mode 100644
index f17ac37..0000000
--- a/java-compact2-example/module.py
+++ /dev/null
@@ -1,5 +0,0 @@
-from osv.modules import api
-
-api.require('openjdk8-zulu-compact2')
-
-default = api.run('/java.so -cp /java-example Hello')
diff --git a/java-compact2-example/usr.manifest 
b/java-compact2-example/usr.manifest
deleted file mode 100644
index f62abc7..0000000
--- a/java-compact2-example/usr.manifest
+++ /dev/null
@@ -1 +0,0 @@
-/java-example/Hello.class: ${MODULE_DIR}/Hello.class
diff --git a/java-compact3-example/Hello.java b/java-compact3-example/Hello.java
deleted file mode 100644
index a605554..0000000
--- a/java-compact3-example/Hello.java
+++ /dev/null
@@ -1,5 +0,0 @@
-public class Hello {
-    public static void main(String[] args) {
-        System.out.println("Hello, World!");
-    }
-}
diff --git a/java-compact3-example/Makefile b/java-compact3-example/Makefile
deleted file mode 100644
index 8a385c9..0000000
--- a/java-compact3-example/Makefile
+++ /dev/null
@@ -1,7 +0,0 @@
-module: Hello.class
-
-%.class: %.java
-       javac -target 7 -source 7 $^
-
-clean:
-       rm -rf *.class
diff --git a/java-compact3-example/module.py b/java-compact3-example/module.py
deleted file mode 100644
index 05cb1f4..0000000
--- a/java-compact3-example/module.py
+++ /dev/null
@@ -1,5 +0,0 @@
-from osv.modules import api
-
-api.require('openjdk8-zulu-compact3')
-
-default = api.run('/java.so -cp /java-example Hello')
diff --git a/java-compact3-example/usr.manifest 
b/java-compact3-example/usr.manifest
deleted file mode 100644
index f62abc7..0000000
--- a/java-compact3-example/usr.manifest
+++ /dev/null
@@ -1 +0,0 @@
-/java-example/Hello.class: ${MODULE_DIR}/Hello.class
diff --git a/openjdk8-fedora-non-isolated/Makefile 
b/openjdk8-fedora-non-isolated/Makefile
new file mode 100644
index 0000000..d04c8e1
--- /dev/null
+++ b/openjdk8-fedora-non-isolated/Makefile
@@ -0,0 +1,40 @@
+#
+# Copyright (C) 2013 Cloudius Systems, Ltd.
+#
+# This work is open source software, licensed under the terms of the
+# BSD license as described in the LICENSE file in the top-level directory.
+#
+
+.PHONY: module clean
+
+jvm_dir=install/usr/lib/jvm
+
+java_version=$(shell ./latest.sh java-1.8.0-openjdk-headless x86_64)
+java_dir=http://mirrors.kernel.org/fedora/development/rawhide/Everything/x86_64/os/Packages/j/
+java_fullname=java-1.8.0-openjdk-headless-$(java_version).x86_64.rpm
+
+tzdata_version=$(shell ./latest.sh tzdata-java noarch)
+tzdata_dir=http://mirrors.kernel.org/fedora/development/rawhide/Everything/x86_64/os/Packages/t/
+tzdata_fullname=tzdata-java-$(tzdata_version).noarch.rpm
+
+SRC = $(shell readlink -f ../..)
+
+module:
+       cd $(SRC)/java && mvn package -q -DskipTests=true
+       mkdir -p upstream
+       wget -c -O upstream/$(java_fullname) $(java_dir)$(java_fullname)
+       wget -c -O upstream/$(tzdata_fullname) $(tzdata_dir)$(tzdata_fullname)
+       rm -rf install
+       mkdir -p install
+       rpm2cpio upstream/$(java_fullname) | (cd install && cpio -id)
+       ln -sf java-1.8.0-openjdk-$(java_version).x86_64 $(jvm_dir)/java
+       rm -rf $(jvm_dir)/java/jre/lib/security/cacerts
+       rm -rf $(jvm_dir)/java/jre/lib/audio/*
+       rpm2cpio upstream/$(tzdata_fullname) | (cd install && cpio -id)
+       cp $(SRC)/java/runjava/target/runjava.jar 
install/usr/lib/jvm/java/jre/lib/ext/
+       ln -s /etc/pki/java/cacerts install/usr/lib/jvm/java/jre/lib/security/
+
+clean:
+       rm -rf upstream install
+       cd $(SRC)/java && mvn clean -q
+       -rm -f dependency-reduced-pom.xml
diff --git a/openjdk8-fedora-non-isolated/latest.sh 
b/openjdk8-fedora-non-isolated/latest.sh
new file mode 100755
index 0000000..36a1269
--- /dev/null
+++ b/openjdk8-fedora-non-isolated/latest.sh
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+package=$1
+
+arch=$2
+
+letter=${package:0:1}
+
+wget -qO- 
http://mirrors.kernel.org/fedora/development/rawhide/Everything/x86_64/os/Packages/$letter/
 | grep "$package-[0-9].*$arch" | sed -e "s/<a 
href\=\"$package-\(.*\)\.$arch\.rpm\".*/\1/g"
diff --git a/openjdk8-zulu-compact3/module.py 
b/openjdk8-fedora-non-isolated/module.py
similarity index 71%
copy from openjdk8-zulu-compact3/module.py
copy to openjdk8-fedora-non-isolated/module.py
index 12f4dc9..153db10 100644
--- a/openjdk8-zulu-compact3/module.py
+++ b/openjdk8-fedora-non-isolated/module.py
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2016 Waldemar Kozaczuk
+# Copyright (C) 2014 Cloudius Systems, Ltd.
 #
 # This work is open source software, licensed under the terms of the
 # BSD license as described in the LICENSE file in the top-level directory.
@@ -11,6 +11,8 @@ import os, os.path
 
 provides = ['java']
 
+non_isolated_jvm = True
+
 api.require('fonts')
 api.require('ca-certificates')
 api.require('libz')
@@ -19,8 +21,8 @@ api.require('httpserver-jolokia-plugin')
 api.require('httpserver-jvm-plugin')
 
 usr_files = FileMap()
-usr_files.add('${OSV_BASE}/apps/openjdk8-zulu-compact3/install').to('/').allow_symlink()
-usr_files.add('${OSV_BASE}/apps/openjdk8-zulu-compact3/install/usr/lib/jvm/java')
 \
+usr_files.add('${OSV_BASE}/apps/openjdk8-fedora/install').to('/').allow_symlink()
+usr_files.add('${OSV_BASE}/apps/openjdk8-fedora/install/usr/lib/jvm/java') \
     .to('/usr/lib/jvm/java') \
     .allow_symlink()
 usr_files.link('/usr/lib/jvm/jre').to('/usr/lib/jvm/java/jre')
diff --git a/openjdk8-fedora-non-isolated/usr.manifest 
b/openjdk8-fedora-non-isolated/usr.manifest
new file mode 100644
index 0000000..dfa1a30
--- /dev/null
+++ b/openjdk8-fedora-non-isolated/usr.manifest
@@ -0,0 +1,20 @@
+#
+# Copyright (C) 2013 Cloudius Systems, Ltd.
+#
+# This work is open source software, licensed under the terms of the
+# BSD license as described in the LICENSE file in the top-level directory.
+#
+
+[manifest]
+/usr/lib/libz.so.1: %(miscbase)s/usr/lib64/libz.so.1
+/usr/lib/&/libexpat.so.1: %(miscbase)s/usr/lib64/&
+/usr/lib/&/libjpeg.so.62: %(miscbase)s/usr/lib64/&
+/usr/lib/jni/balloon.so: java/jni/balloon.so
+/usr/lib/jni/monitor.so: java/jni/monitor.so
+/usr/lib/&/jni/elf-loader.so: java/&
+/usr/lib/&/jni/networking.so: java/&
+/usr/lib/&/jni/stty.so: java/&
+/usr/lib/&/jni/tracepoint.so: java/&
+/usr/lib/&/jni/power.so: java/&
+/java.so: java/jvm/java_non_isolated.so
+/java/cloudius.jar: ${OSV_BASE}/java/cloudius/target/cloudius.jar
diff --git a/openjdk8-zulu-compact1/module.py b/openjdk8-zulu-compact1/module.py
index ac7dbcc..fc94a3d 100644
--- a/openjdk8-zulu-compact1/module.py
+++ b/openjdk8-zulu-compact1/module.py
@@ -11,6 +11,8 @@ import os, os.path
 
 provides = ['java']
 
+non_isolated_jvm = True
+
 api.require('fonts')
 api.require('ca-certificates')
 api.require('libz')
diff --git a/openjdk8-zulu-compact2/module.py b/openjdk8-zulu-compact2/module.py
index 4385a78..6642b11 100644
--- a/openjdk8-zulu-compact2/module.py
+++ b/openjdk8-zulu-compact2/module.py
@@ -11,6 +11,8 @@ import os, os.path
 
 provides = ['java']
 
+non_isolated_jvm = True
+
 api.require('fonts')
 api.require('ca-certificates')
 api.require('libz')
diff --git a/openjdk8-zulu-compact3/module.py b/openjdk8-zulu-compact3/module.py
index 12f4dc9..78da3b9 100644
--- a/openjdk8-zulu-compact3/module.py
+++ b/openjdk8-zulu-compact3/module.py
@@ -11,6 +11,8 @@ import os, os.path
 
 provides = ['java']
 
+non_isolated_jvm = True
+
 api.require('fonts')
 api.require('ca-certificates')
 api.require('libz')
-- 
2.7.4

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to