Build a Java language unikernel, (OSv unikernel)
1. Follow the official tutorial steps, with the previously built Rumprununikernel(go language) and Includeosunikernel(C + + Language), it is necessary to install JDKmaven
Reference Tutorial:
1) Install JDK inUbuntu 14.04.1
Http://www.linuxidc.com/Linux/2015-01/112030.htm
Verify that the JDK is installed successfully:$ Java--version
2) install Maven inUbuntu 14.04.1
Http://www.linuxidc.com/Linux/2015-03/114619.htm
Verify that maven is installed successfully:$ mvn--version
2. Detailed tutorial on building OSV Unikernel
Https://github.com/cf-unik/unik/blob/master/docs/getting_started_java.md
OneWrite a Java HTTP server using Maven
Precautions:
1)pom.xml文件的修改:注意maven-assembly-plugin其内容插入的位置!
2) When executing the command, the build fails if the JDK is not installed correctly:
mvn package && java -jar target/my-app-1.0-SNAPSHOT-jar-with-dependencies.jar
Diagram of successful execution:
3) visithttp://localhost:4000/to see that theserver is running.
Test result diagram:
Second,Compile an image and run on Virtualbox
1. Make sure it is up and running, and then execute the following command:
PATH_TO_JAVA_PROJECT --base osv --language java --provider virtualbox
注意:Replace Path_to_java_project with the path where we created the JAVA Project root directory. ( that is, the directory that contains the Pom.xml file). For example :
/home/shm/myJava/my-app/ --base osv --language java --provider virtualbox
Test run:
the terminal of the Unik daemon will display:
In the browser:
The problem is that you cannot browse in the browser because the running instance is not assigned to an IP address, only Unik_virtualbox has an IP address.
Building a Java language Unikernel, (based on OSV Unikernel)