Re: [Jamvm-general] Proof Of Concept : an alternative to OpenJDK
Brought to you by:
rlougher
From: johann S. <sor...@in...> - 2013-06-05 18:14:23
|
Thanks for the details, here are a few more questions : Is making an implementation of java.lang.* classes an obligation ? How can I say... I would like to plug in JamVM at a lower level, under the 'java protocol'. I see there is a specific libjvm.so so it looks like all the java binding occurs in it, so maybe it could be possible to make a different binding ? Is there some kind of jamVM kernel isolated from the java model ? Johann Sorel > -----Original Message----- > From: xe...@za... > Sent: Wed, 05 Jun 2013 13:00:30 +0200 > To: sor...@in..., jam...@li... > Subject: Re: [Jamvm-general] Proof Of Concept : an alternative to OpenJDK > > 2013-06-03 23:41, johann Sorel skrev: >> Hello > > Hi Johann! > >> >> I would like some advices from some peoples working on JamVM : >> >> I have been working for several months now on a public domain general >> purpose library (think of it as a replacement to the ClassPath lib). The >> projet is going pretty well and is starting to be self sufficient. (for >> those interested : https://bitbucket.org/Eclesia/un/wiki/Home) >> >> Now I would like to make a Proof Of Concept that my project can live on >> it's own without the JVM APIs and classes. Basicly I would like to >> obtain a draft of VM using JamVM as "kernel" and my project as the main >> library. > > You can use the jamvm libjvm.so standalone in combination with your own > projects class library > >> >> - Can JamVM be used without ClassPath/OpenJDK ? > yes create your own jvm launcher using the "JNI Invocation Interface" > I recommend you to take a look at Chapter 7 (page 83) of the "The Java™ > Native Interface Programmer’s Guide and Specification" book > http://web.archive.org/web/20120905183616/http://java.sun.com/docs/books/jni/download/jni.pdf > >> - Will I need to code some JNI for low level operations ? >> or are they provided ? (Streams,Sockets,...) > You need to implement all classes you need like a ClassLoader, String, > Object and Class class. And you need to use JNI to do low level > operations. > > >> >> If you think it is possible : where should I start ? >> >> Thanks >> >> Johann Sorel > > > jamvm libjvm finds the JRE classes relative to the libjvm.so thus the > folder layout is important. > You may setup a project structure like this: > > jamvmMini$ find . > . > ./compile.sh > ./jre > ./jre/classes/java/lang/Object.java <-- you will have to provide your own > implementation of all java/lang classes > ./jre/classes/java/lang/String.java > ./jre/classes/java/lang/Class.java > ./jre/classes/java/lang/ClassLoader.java > ./jre/classes/java/lang/... > ./jre/lib/jvm/jamvm/libjvm.so <- jamvm built using instructions from: > http://draenog.blogspot.se/2011/02/openjdkjamvm-git-repository.html > ./Prog.java <- the main application to run > ./myJVM.c <- example code from "Chapter 7 (page 83) of the "The Java™ > Native Interface Programmer’s Guide and Specification" book" > ./run.sh > > jamvmMini$ cat compile.sh > #compile launcher > gcc myJVM.c -ljvm -L./jre/lib/jvm/jamvm/ > #compile java.lang classes > cd jre/classes > javac java/lang/*.java > cd ../../ > #compile application > javac Prog.java > #compile jamvm launcher > gcc myJVM.c -o jamvm-launcher -ljvm -L./jre/lib/jvm/jamvm/ > > jamvmMini$ cat run.sh > #run launcher > LD_LIBRARY_PATH=./jre/lib/jvm/jamvm/ ./jamvm-launcher > > Cheers > Xerxes ____________________________________________________________ FREE 3D MARINE AQUARIUM SCREENSAVER - Watch dolphins, sharks & orcas on your desktop! Check it out at http://www.inbox.com/marineaquarium |