Solved

native converters for Swing java applications

Posted on 2002-06-18
23
382 Views
Last Modified: 2013-12-29
We have a problem; the JRE is too big for our customers.

(yeah, I know, the smallest version is only 5.7mb - but they still feel that this is a "huge barrier" for them).

So, we are looking at some solutons to this problem.

1. Convert our .class files to a native .EXE application, and pack all needed libraries with it (haven't found anyone that supports Swing independently of Sun's JRE - ex; Excelsior JET).

2. Strip the JRE - which is illegal, so we can't do that :|

3. Alternative, smaller VM's; haven't found anyone that can handle Swing independently of Sun's JRE yet.

suggestions?

- bjorn
0
Comment
Question by:borbjo
  • 7
  • 6
  • 3
  • +5
23 Comments
 
LVL 86

Expert Comment

by:CEHJ
ID: 7089778
listening...
0
 
LVL 4

Expert Comment

by:pellep
ID: 7090976
I seem to recall reading a whitepaper on the latest VisualCafe including a native compiler/linker that supported Swing as well. No guarantees, but check it out.
0
 
LVL 92

Expert Comment

by:objects
ID: 7091657
> the JRE is too big for our customers.

Then why were you developing in Java in the first place?

Only other alternative I can think of besides the ones you already mentioned are to rewrite as a native application.
0
 
LVL 92

Expert Comment

by:objects
ID: 7091694
If it runs on a web interface then the following may help:

http://creamtec.com:30422/webcream/
0
 

Author Comment

by:borbjo
ID: 7091880

Webcream? .. I think Google's comment is appropiate:
"Claims to convert Java GUI client-side applications to HTML/JavaScript-based front end with no recoding. [Commercial]"

Claims to .. I don't think so ..

pellep; we're developing in Java because we are a java company. But when our customers heard they needed that plugin, they started backing out ...

An alternative may also be doing it in some .NET way, but I don't want that.

- bjorn
0
 
LVL 92

Expert Comment

by:objects
ID: 7091898
> Claims to .. I don't think so ..

I agree they are bold claims.
I believe they have a trial version if you want to try it out.

> But when our customers heard they needed
> that plugin, they started backing out ...

First thing you should be making a client aware of :-)

> An alternative may also be doing it in some .NET way,
> but I don't want that.

ie. rewrite it.
0
 

Author Comment

by:borbjo
ID: 7091901

sorry, my previous comment was to objects, not pellep..

I checked out Visual Café, and yes it does have a native compiler.

From the features matrix:
"Native JDK 1.3 and Java 2 x86 compiler with support for dynamically loaded classes. "

.. doesn't say anything about Swing though.
I'll try to find out more about it and post it here..

- bjorn
0
 
LVL 92

Expert Comment

by:objects
ID: 7091905
You could try porting it to AWT/1.1. Gotta be less work than rewriting in another language.
Or perhaps just getting it working with 1.1 so they only need to download Swing classes.
0
 

Author Comment

by:borbjo
ID: 7091909

It's a graphics program.

The program uses Java2D heavily for rotation, scaling, etc. of images and shapes.

so, we kind of need JDK 1.4.0 ...

Also, last I checked the JDK 1.1 download was 11 MB(!) .. maybe I found some strange version or something, but it was on Sun's site ..

- bjorn
0
 
LVL 92

Expert Comment

by:objects
ID: 7091920
> last I checked the JDK 1.1 download was 11 MB(!)

They don't need the JDK, only a runtime.
Plus most browsers come with 1.1 support.
0
 

Author Comment

by:borbjo
ID: 7091923

It's a graphics program.

The program uses Java2D heavily for rotation, scaling, etc. of images and shapes.

so, we kind of need JDK 1.4.0 ...

Also, last I checked the JDK 1.1 download was 11 MB(!) .. maybe I found some strange version or something, but it was on Sun's site ..

- bjorn
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

Author Comment

by:borbjo
ID: 7091928

woops, sorry about that .. I did a refresh to view your message and then it posted mine over again :|

anyway, most browsers - meaning IE (which are "most browsers") don't come with any Java support at all as far as I know - after the lawsuit from Sun. (You know, the whole "Microsoft Virtual Machine" blabla)

besides, this is an application, not an applet.

So, we're kinda stuck it seems :/

- bjorn
0
 
LVL 16

Expert Comment

by:heyhey_
ID: 7092171
native compiler will include almost the same amount of code as JRE does. If your app uses java.utl.Vector and javax.swing.JFrame, these classes will have to be included in some form or another with the final distribution.
0
 

Author Comment

by:borbjo
ID: 7092250

Hey hey hey :)

which native compiler are you talking about here?

I've testes Excelsior JET, which says it depends on Sun's JDK if your application uses Swing or AWT.

Others I've had a look at have the same problem.

- bjorn
0
 
LVL 2

Expert Comment

by:mariuso
ID: 7092301
gcj 3.1 can be a solution. But is not working for windows (if i'm well informed.)
0
 
LVL 16

Expert Comment

by:heyhey_
ID: 7092303
I've used (in past) IBM HPJC and Symantec native compilers. Both of them used something like "precompiled" core Java libraries. For example application compiled with HPJC mut be distributed with
- util.hll (for example 1Mb) - it your app uses java.util.* classes
- awt.hll (for example 3Mb) - it your app uses java.awt.* classes
and so on
0
 
LVL 92

Accepted Solution

by:
objects earned 34 total points
ID: 7094171
> meaning IE (which are "most browsers") don't come with
> any Java support at all

It's been dropped from XP, but all other Win versions still have one.
Hopefully not delivering XP with Java support will result in people installing the plugin and provide some decent Java support :)

> besides, this is an application, not an applet.

They still have JVM (albeit a shitty one).

> So, we're kinda stuck it seems :/

You are a bit, I doubt a native compiler will help you for the reasons discussed above. And if you go to any Java forum you'll find page of discussions about it, but no silver bullet.

One option may be to lobby your client on the values of installing Java and convince them that it's the way to go. As a Java company this is your duty :-)
And if their running the app on an intranet, then the plugin can be made available locally on their intranet and web based install setup which would cut the download time right down. You could also make your app available via WebStart to make the Java option more attractive.

Failing this I don't see any way around a rewite, sorry.
0
 
LVL 1

Assisted Solution

by:wgilster
wgilster earned 33 total points
ID: 7174805
You mentioned this:
>An alternative may also be doing it in some .NET way, but I don't want that.
But it really doesn't make sense to me.
Instead of installing the JDK, they are installing the .NET run times.  It seems like your not gaining any ground by going that route.

The only way that you KNOW that .NET is installed is if ALL your clients own XP.  Any other OS is not garenteed to have the .NET runtimes installed.  Just because .NET can be packaged into your application doesn't mean that your going to have a leaner program.  Remember the days where 2 line VB programs were 3Mb.  .NET only makes things worse.

Every modern development language today has library requirements, Java is just another one of them.  

>haven't found anyone that can handle Swing independently of Sun's JRE yet.
I would like to know which VM's don't support Swing.  Swing is 100% pure java, based on the AWT, but still pure java.  Apparently your looking at VM's that also don't support the AWT?
0
 

Author Comment

by:borbjo
ID: 7184507
>I would like to know which VM's don't support Swing.  
>Swing is 100% pure java, based on the AWT, but still pure
>java.  Apparently your looking at VM's that also don't
>support the AWT?

I wrote: "independently of Sun's JRE"  ... and the topic here is "native compilers".

They all support the AWT, but not Swing.

- bjorn
0
 
LVL 16

Assisted Solution

by:heyhey_
heyhey_ earned 33 total points
ID: 7184528
> They all support the AWT, but not Swing.

Swing 1.0.3 is implemented in pure Java so you can compile it like any other Java .class files.
0
 
LVL 1

Expert Comment

by:wgilster
ID: 7185237
I agree with heyhey, this statement is immpossible:
>They all support the AWT, but not Swing.

Swing is pure java, that's really all there is to it.  I can see if a native compiler didn't support the AWT it wouldn't also support Swing.  But by it's very definition it must support Swing if it supports all facets of the Java language.  That's why 100% pure Java programs are so beneficial.
0
 
LVL 35

Expert Comment

by:girionis
ID: 8860514
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this
question is:

- split points among objects, heyhey_ and wgilster.

Please leave any comments here within the
next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER !

girionis
Cleanup Volunteer
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

For customizing the look of your lightweight component and making it look lucid like it was made of glass. Or: how to make your component more Apple-ish ;) This tip assumes your component to be of rectangular shape and completely opaque. (COD…
An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now