From owner-freebsd-java@FreeBSD.ORG Thu Jan 22 10:26:26 2015 Return-Path: Delivered-To: freebsd-java@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 424E8D0A for ; Thu, 22 Jan 2015 10:26:26 +0000 (UTC) Received: from ms-10.1blu.de (ms-10.1blu.de [178.254.4.101]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 066ACBE9 for ; Thu, 22 Jan 2015 10:26:25 +0000 (UTC) Received: from [89.204.154.120] (helo=c720-r276659) by ms-10.1blu.de with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1YEExs-00027L-Ko; Thu, 22 Jan 2015 11:26:17 +0100 Date: Thu, 22 Jan 2015 11:26:14 +0100 From: Matthias Apitz To: freebsd-java@freebsd.org Subject: executing Java written code from C pgm Message-ID: <20150122102614.GA2046@c720-r276659> Reply-To: Matthias Apitz Mail-Followup-To: Matthias Apitz , freebsd-java@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline X-Operating-System: FreeBSD 11.0-CURRENT r269739 (i386) User-Agent: Mutt/1.5.23 (2014-03-12) X-Con-Id: 51246 X-Con-U: 0-guru X-Originating-IP: 89.204.154.120 X-BeenThere: freebsd-java@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Porting Java to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jan 2015 10:26:26 -0000 Hello, I have some C/C++ written servers and want to use code (classes) written in Java. I figured out how the load the JVM and to reference into the class as C function calls. I can post the details if someone is interested it this. The problem is that the a.out must be linked against the JVM (libjvm.so) and the resulting process is around 300 MByte (text, data and bss), which makes it unusable in production (where some 200-300 processes of this are running). Is there some way to compile the Java code to machine code with needing a JVM to execute this? Thanks in advance matthias -- Matthias Apitz, guru@unixarea.de, http://www.unixarea.de/ +49-170-4527211 1989-2014: The Wall was torn down so that we go to war together again. El Muro ha sido derribado para que nos unimos en ir a la guerra otra vez. Diese Grenze wurde aufgehoben damit wir gemeinsam wieder in den Krieg ziehen.