• Register
0 votes
1.4k views

Problem :

I am beginner to Java. I have one doubt about Java Compilers as below.

For compiling a java code we have separate compilers for different os.”

Can someone answer my question?

8 4 2
2,300 points

1 Answer

0 votes

Solution :

I have gone through your question. Almost everybody who is new to Java has this doubt. The JDK consists of compiler and JVM.

The Compiler will compile java file it means it will convert a .java file to a .class file. As .class file is completely platform independent it means compiled class file of your java file will be the same for all Operating Systems so  from the algorithmic perspective we can say that the compiler is same across all the platforms. As it is the executable file so the file itself will be different for Windows  it will be .exe and for Linux it will be Linux executable etc.

Now the JVM converts bytecode  i.e our .class file  to the 'system specific' code. As the system specific code is dependent on its OS. So from the algorithmic point of view the JVM is different across all OS. Also the actual file will also be completely different on different OS.

I hope now you are clear about Java Compiler.

5 2 1
4,980 points

Related questions

0 votes
1 answer 95 views
95 views
Problem : I am having a box with 8gb of ram, so I don't think the total memory is the issue. This application is running properly on boxes with 6gb or less ram. What I am trying to do is to reserve 3GB of space using -Xmx3G command under "VM ... : Error occurred during initialization of VM; Could not reserve enough space for object heap using -Xmx3G Why am I getting such error any clue?
asked Nov 26, 2019 alecxe 7.5k points
1 vote
2 answers 104 views
104 views
Problem: Dear all, Right now I’ve imported a maven project into my eclipse IDE and I changed my java path library to work on java 1.7 Suddenly, eclipse started showing an error but I’ve got no errors in my files there. The error is “java compiler level ... Project Problem (Java Version Mismatch) Please tell me how to resolve this error (I want to have my JRE version as 1.7 only).
asked Mar 22 Gavin 15.3k points
0 votes
1 answer 6 views
6 views asked Sep 22 miki 1.1k points
0 votes
2 answers 20 views
20 views
Is it possible to dynamically compile and execute C# code fragments?
asked Aug 28 Aliza313 720 points
1 vote
1 answer 1.4K views
1.4K views
Problem: I am a windows seven user and recently I’ve installed JDK to learn java but I am getting an error. The message is something like: Missing server JVM at `C:\Program Files\Java\jre7\bin\server\jvm­­.dll' please install or use the JRE or JDK that contains these missing components. Your kind solution is much appreciated.
asked Mar 22 Gavin 15.3k points