Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does Java differ on different platforms?

Tags:

java

linux

unix

jvm

I am currently in high school. I was recently browsing the internet looking for what employees in the software industry usually want and what the job requirements are like.

I came accros a job description and one of the requirement is:

Strong, object-oriented design and coding skills (C/C++ and/or Java preferably on a UNIX or Linux platform)

Note the last part: Java preferably on a UNIX or Linux platform.

I don't understand this. Isn't Java run inside a virtual environment/machine? Why would it matter what OS it is running on since Java cannot directly interact with the OS?

like image 392
Krimson Avatar asked Jul 04 '26 08:07

Krimson


2 Answers

A developer job description may require experience with some OS for several reasons:

  1. First, as you noticed already, there are languages that talk directly to the OS and the code needs to be aware of the underlying OS (like C/C++, which are listed in your job description).

  2. Secondly, even if the programming language abstracts away anything that's OS-specific from you (including the file-system / path separators), you are still going to deploy / configure / run / monitor your applications on top of some OS and you need to know (at least) the basics in order to do that.

For a Java job description, If UNIX/Linux "is a plus", it usually means you're going to run your code on a UNIX/Linux system and you should know how to start a process (your own java app or some application server), how to deploy an application in a container, how to read log files and so on...

like image 173
Costi Ciudatu Avatar answered Jul 07 '26 01:07

Costi Ciudatu


Develop once debug everywhere

While conceptually it shouldn't make any difference on what target platform the java code is executed on unfortunately in practice it isn't always that simple but a rather tedious task to get the code running on any platform.

Beginning from easy to circumvent mistakes e.g. using / or \ instead of java.io.File.separatorChar or : / ; instead of or java.io.File.pathSeparatorChar there are most often problems including methods implemented in native code that often aren't that compatible across different platforms.

It might be even possible your employer is looking for someone to implement native java methods using JNI.

like image 33
mikyra Avatar answered Jul 06 '26 23:07

mikyra



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!