English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

Hi,
I do not have much experience in programming and would liek to know if for instance I install a Java SDK in ubuntu and then create and application, when it is compiled, is it usable for Windows too or do I have to specify the platform when I start writing the application project?

Thanks in advance.

2007-07-07 08:16:13 · 3 answers · asked by Anonymous in Computers & Internet Programming & Design

3 answers

Java is platform independent, so you do not have to decide up-front what operating system you are coding for. Most applications that you write will run on Windows, Mac, Linux, etc. You take your compiled .jar and it should run the same way on any system.

However, you have to be careful that you don't code in platform-specific quirks in your Java (spawn a shell to execute an operating system command, assume the filename path separator is the windows-specific '\', etc.)

If you stick to very "vanilla" Java features, you won't have to worry. For any large or complicated application, however, some care must be taken to ensure that it is portable, and it will have to be tested on the various target systems that you want it to run on. (Java's marketing promise is "write once, run everywhere" but we joke that it is more like "write once, debug everywhere.").

A big Java application that I work with, for example, has to figure out the MAC address of the system it runs on; this cannot be done in a platform-independent way, so we have to code it one way for Unix and another way for Windows. However, 99.9% of this application's code will run on everything from AS/400 IBM mainframes to Solaris to AIX to Linux to Windows, without modification... and we have isolated the platform-specific parts to ease the transition to new environments.

2007-07-07 08:43:00 · answer #1 · answered by McFate 7 · 0 0

First as a warning on the digital disk. I even have tried that, it truly is volatile and could have a heavy slowdown on your pc. particularly the belief of two OS's on one pc could make it greater good in a fashion of speaking. we could say something is going incorrect on your residing house windows section. in basic terms bounce into linux and decide a thank you to repair it. or you are able to bypass vice versa (in spite of the very incontrovertible fact that residing house windows does require greater effective utility to get well linux). the only factor risky is the boot loader yet I even have not had any problem with it and, if it truly does get twisted up, the stay CD for ubuntu has fixes for the boot loader. i'm curently twin booting my computing device and it in basic terms has approximately 20 GB. It has no longer failed as quickly as. in basic terms as an element observe, repartioning is somewhat volatile yet after that's finished, if each and everything is unbroken each and everything resumes stability. Basicly, you're risk-free. good success.

2016-10-20 04:57:17 · answer #2 · answered by ? 4 · 0 0

actually the whole point of Java is that it is portable... it can be used on any platform that has an appropriate JRE installed

2007-07-07 08:21:09 · answer #3 · answered by EVOX 5 · 0 0

fedest.com, questions and answers