Java compiler: Difference between revisions

Content deleted Content added
Line 16:
* [[GNU Compiler for Java]], a part of the [[GNU Compiler Collection]], which compiles [[C (programming language)|C]], [[Fortran]], [[Pascal programming language|Pascal]] and other [[programming language]]s besides Java. It can also generate [[native code]] using the back-end of GCC.
* ECJ, the Eclipse Compiler for Java, is an open source [[incremental compiler]] used by the [[Eclipse (software)|Eclipse]] project.
 
 
==How to compile and run Java in terminal (mac) or windows
Open terminal or command prompt to get to the directory you are working in. So if your folder is C:\desktop\testJAVA you need to be in this folder to use the commands, not in e.g. C:\ folder only.
 
To get to the directory use cd command. e.g.
 
cd desktop
cd foldername
 
To compile the Java file type in
 
javac filename.java
 
This produces a class file
 
To run this class file type java followed by the filename without the extension of .class
 
e.g. java filename
 
== Java decompilers ==