Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   Java (http://www.programmingforums.org/forum17.html)
-   -   Java without runtime? (http://www.programmingforums.org/showthread.php?t=14365)

DESERVE Nov 8th, 2007 10:15 AM

Java without runtime?
 
Is it possible to just write a Java program without using the Runtime behind it?

I.E. compile it straight to Machine Code like you would a C++ program?
_________________
Black Box Products Distributor How to trace a telephone number

ReggaetonKing Nov 8th, 2007 10:18 AM

Re: Java without runtime?
 
GNU developed something called GCJ. It compiles to either byte or machine code. Haven't used it myself but I have it installed just in case I ever wanted to play around with it.

Check it out.
http://gcc.gnu.org/java/

Jimbo Nov 9th, 2007 2:17 AM

Re: Java without runtime?
 
Yeah, I've heard about some Java to native compilers but I don't remember hearing much of anything good about them.

Grich Nov 9th, 2007 6:26 AM

Re: Java without runtime?
 
Quote:

Originally Posted by ReggaetonKing (Post 136463)
GNU developed something called GCJ.URL]

I've used it once. It's like any other compiler. It does compile to machine code. I have heard from others that it does have some limits.

mrynit Nov 9th, 2007 6:39 AM

Re: Java without runtime?
 
you could try looking at this http://mcujavasource.sourceforge.net/index.xhtml

Harakim Nov 13th, 2007 3:02 AM

Re: Java without runtime?
 
They are also working on a Java Kernel that will interpret Java applications, but will be rolled into an executable with your class files. It is supposed to add about as much overhead as a windows executable. We will see how this ends up when Java 7 comes out.

lectricpharaoh Nov 13th, 2007 5:09 AM

Re: Java without runtime?
 
Quote:

Originally Posted by Harakim
They are also working on a Java Kernel that will interpret Java applications, but will be rolled into an executable with your class files. It is supposed to add about as much overhead as a windows executable. We will see how this ends up when Java 7 comes out.

Sounds promising, except that much of the overhead probably from the necessary classes that need to be included from the Java libraries. Since there is likely to be a lot of duplicate class usage across applications- for example, two different applications using Swing will each have their own copy of the classes- this will be a lot of wasted space. It's one of the big reasons dynamic linking can be an advantage. The way around this, of course, is to have everyone download a set of Java classes, but then we're back to square one. It also assumes that the Java classes themselves are platform independent, and I'm not sure they are; it's only the interface that's guaranteed to be consistent.

Harakim Nov 14th, 2007 3:10 AM

Re: Java without runtime?
 
Most of the java classes are cross-platform. They have made a movement towards this recently. However, some classes must be implemented for a native operating system (sockets and windows come to mind). On the other hand, if you are distributing an executable, it isn't going to be cross platform anyway.

null_ptr0 Nov 21st, 2007 10:05 PM

Re: Java without runtime?
 
The GCC, GNU Compiler Collection, contains a java compiler, that has the ability to compile java source files into executable files containing the bytes of assembler instructions; or 'machine code'.


All times are GMT -5. The time now is 3:22 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC