Building a Java language Unikernel, (based on OSV Unikernel)

Source: Internet
Author: User

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)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.