• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
  • Junilu Lacar
Sheriffs:
  • Tim Cooke
  • Jeanne Boyarsky
  • Knute Snortum
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • salvin francis
  • fred rosenberger
  • Frits Walraven

Unix + Java

 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everyone,
Could anyone let me know why Unix is used in combination with Java?

Thanks,
bobby
 
author & internet detective
Posts: 39957
804
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bobby,
UNIX is an operating system. Java runs on an operating system. Java can run on UNIX (or Windows or Mac or Linux or ...)
 
bobby reddy
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Jeanne Boyarsky,
Whats the difference in the Java application that makes use of Unix or Windows operating system?
Can the same Java application work on two different OS?

bobby
 
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Bobby,

A java application, once written and tested can be run on both a UNIX and Windows operating system. You do not have to alter the code for it to work for different environments.

Regards

Matt Gaunt
 
lowercase baba
Posts: 12834
52
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are some caveats to that. it is certainly possible to write some java code that IS system dependent, but this usually means you've used some non-standard classes/packages.

You can also write your java to make system calls (i.e. call a program that the OS runs... i.e. on windows, you could call 'dir' to list the files) which would not work across platforms.
 
Sheriff
Posts: 11343
Mac Safari Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by bobby reddy:
...Can the same Java application work on two different OS? ...


Absolutely. This is the idea behind compile once and run anywhere.

The thing is: The different platforms must be running their own (OS-specific) Java Virtual Machine (JVM). This is what allows the same compiled bytecode to run on different platforms. As pointed out, JVMs can run on Windows, Mac, Linux...
 
Ranch Hand
Posts: 202
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
for examples:
Delphi not run in all operation system. Today he give support there are some system as a unix.
Java run independent of the plataform that you use. can be unix, mac, windows. not is necessary move one line of the code for this.
 
And inside of my fortune cookie was this tiny ad:
Two software engineers solve most of the world's problems in one K&R sized book
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic