Comman JRE for all OS

Hi experts

i have an client application made using java swings
while deployment on user machines (some are windows and some are linux)
i copy the whole jdk inside the app folder and avoid using
JRE installed on thatmachine.another reason for this is my app requires jdk bcos
jasper reports need the java compiler for compiling the report files at runtime
and JRE does not contain javac compiler

/myapp/myapp.jar  the executable file

now the issue is on linux i have different jdk folder(containing shell scripts) and
on windows i have diffent jdk folder(containing exe's
this is make my life miserable as i have to maintain 2 copies of source and 2 separate
folders for differnt users so that they are not confused
and when i upgrade my version of app the user takes the backup of whole app folder
which is consuming disk(redundant files for images and other folders)

is there a way i can create a single installation folder for both OS

pls help
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Mayank SAssociate Director - Product EngineeringCommented:
Well, the JRE is different for different machines, if you understand the concept of JVM and why Java is platform independent, why source files are compiled into class-files or byte-code and why they are interpreted by the JVMs specific to the platforms.
No, or you would have to rewrite everything in pure JAVA yourself.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Mayank SAssociate Director - Product EngineeringCommented:
And the JDK for each platform is different too :)
Introduction to R

R is considered the predominant language for data scientist and statisticians. Learn how to use R for your own data science projects.

Mayank SAssociate Director - Product EngineeringCommented:
>> different for different machines

I meant different platforms.
Better verify that the client-machine has a JDK or automate the downloading and installation of the proper JDK.

EconifyAuthor Commented:

hey mayank

i dont know much about JVM,s ,byte-code and platforms as much u know
i think are quite a expert
so instead of writing why...why...why
try to explain the issue

well i guess there a solution....not sure
if i merge the two jdk 1.4 folder then the bin folder will have
the exe's for windows and the scripts for linux
this way windows clients will pick what it requires and linux will get what it wants for running the app

how bout that

any ideas.
Mayank SAssociate Director - Product EngineeringCommented:
Well :) that's why I asked 'if' you understand ;-)

Java is platform independent because it follows a 2-way process. First the source-code is compiled into byte-code which is like an optimized set of instructions. This byte-code is same for all platforms. Then an interpreter interprets this byte-code into platform-specific native code (hence, the interpreter has to be platform-specific). Even the size of primitive data-types are same on all platforms unlike C/ C++.

>> if i merge the two jdk 1.4 folder then the bin folder will have

Well, that's a bad work-around :) what will you do if some client uses Mac later? Add another folder? I don't think that's the right solution. Will need to think more for this.
Yes, Mac, and how about Motorola, VAX, Solaris, HP-PA .... all other versions with another JDK needed.
......... and if new JAVA versions are released?

Take care that the client or customer installs the right JDK,
rather than that you carry everything with your software.

Mayank SAssociate Director - Product EngineeringCommented:
Exactly, you should put JDK as a requirement (pre-requisite) for your application to run. Then depending upon the SLA (service-level agreement), it is either the client's technical group's job to install them on each system where the application is to be deployed, or yours.
Mayank SAssociate Director - Product EngineeringCommented:
The JDK also needs to be 'installed' over the OS, so simply copying the files into a directory will not help.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.