JRE

A

azsx

Who can tell me how can i run java programs with very small JRE??? My
JRE is 50 MB
 
R

Roedy Green

Who can tell me how can i run java programs with very small JRE??? My
JRE is 50 MB

You mean you want a cell phone sized Java? The smaller versions don't
have the some class libraries available, so you can't run standard
desktop apps on them.
 
A

azsx

I mean that i want to invoke the JVM having a very small JRE. say I
want to make a game in java and distibute it with this JRE.
 
L

Luc The Perverse

azsx said:
I mean that i want to invoke the JVM having a very small JRE. say I
want to make a game in java and distibute it with this JRE.

You may be interested in compiling natively.

Consumers in general are not concerned or aware of memory usage and those
who are usually have a lot of ram ;)
 
C

christian.jean

A few years ago I use to clean the JRE before packaging it for
deployment.

Although at that time there were not too many files you could get rid
of and the JRE remained quite large. Time has changed, maybe Sun has
made some good changes, but I doubt it. If you look in the
documentation at the root of the JRE they document every file which is
mandatory and which is optional.

You may want to take a look at deploying your game with JavaStart or
JavaWebStart (or something like that).

Good luck,

Jeach!
 
L

Luc The Perverse

A few years ago I use to clean the JRE before packaging it for
deployment.

Although at that time there were not too many files you could get rid
of and the JRE remained quite large. Time has changed, maybe Sun has
made some good changes, but I doubt it. If you look in the
documentation at the root of the JRE they document every file which is
mandatory and which is optional.

You may want to take a look at deploying your game with JavaStart or
JavaWebStart (or something like that).

Good luck,

Jeach!

Wait . . . to the OP:

Are you trying to minimize installation size, or memory while in use. If
you are concerned about the actual disk usage, or space on a DVD - I think
you needn't concern yourself. If people have no already installed the JRE -
they would appreciate having the whole thing likely.
 
A

azsx

I want to create an *.exe written in c++ but which uses Java. For this
i have to use JNI and also the JRE. But i want the final package to be
as small as posible. So i need the smaller JRE i can get. Who can give
me links or sugestive ideas?
 
J

Jeffrey Schwab

azsx said:
I want to create an *.exe written in c++ but which uses Java. For this
i have to use JNI and also the JRE. But i want the final package to be
as small as posible. So i need the smaller JRE i can get. Who can give
me links or sugestive ideas?

Assuming that you are targeting modern desktop or server platforms...

Don't use JNI. Write one program in C++ and another in Java, and let
the two communicate via IPC. Don't bundle the JRE with your program:
use the existing JRE on the target platform. (I'm always annoyed when
an application bundles its own JRE, rather than using the perfectly
serviceable one I have already installed.)
 
A

azsx

Can you be more specific? An example would be much more helpfull.
Thanks! How can a program written in C++ comunicate with one written in
Java via IPC?
 
A

azsx

Can someone give me an example of a program written in java and
transformed *.exe? I could do this via JNI, invokation API. But it
requires JRE. and it is too big. So I need either another method of
doing this or another JRE, smaller one.
 
O

Oliver Wong

azsx said:
Can someone give me an example of a program written in java and
transformed *.exe? I could do this via JNI, invokation API. But it
requires JRE. and it is too big. So I need either another method of
doing this or another JRE, smaller one.

If you compile your Java code to .class files, then you'll need a JVM to
run those files. There are "alternative JVMs", but they probably won't solve
your problem, as the bulk of the size of the JRE is the class files, not the
JRE, and I believe Sun has some licensing rules that say you can't make the
JRE smaller by omitting the stuff you don't need.

The advice you received earlier about not bundling the JRE was telling
you to tell your users to download and install the JRE themselves.

If you don't want to do that, you'll have to compile your Java code to
executables. Try gcj (http://gcc.gnu.org/java/index.html) or Excelsior Jet
(http://www.excelsior-usa.com/jet.html).

- Oliver
 
J

Jeffrey Schwab

azsx said:
Can you be more specific? An example would be much more helpfull.
Thanks! How can a program written in C++ comunicate with one written in
Java via IPC?

IPC stands for Inter-Process Communication, and can refer to any
technique multiple processes (or according to Wikipedia, multiple
threads) use to talk with each other. You might use sockets or shared
memory, but I find that plain old pipes are usually powerful enough for
my needs. Here's some sample code:

http://schwabcenter.com/cljp/

In this example, the Java code calls a native executable, and the two
process communicate by text messages across ordinary I/O streams. Nice
and simple.
 

zzt

Joined
Jul 2, 2010
Messages
1
Reaction score
0
Look for "Java Runtime Slim-Down". For GUI applications, it promises the size of a complete installation package without dependency on the JRE starts from 5MB.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top