What's new

Java compile and run java file using terminal

fireclouu

Honorary Poster
Joined
Jun 1, 2014
Posts
440
Solutions
1
Reaction
152
Points
190
run your java file directly to terminal :)

dependencies to install:
  • ecj
  • dx

please note, hindi pa supported ang stitched class compilations, meaning single class lang ico-compile niya, if you can improve it, you can freely modify it.

para sa mga gusto magpractice sa java.

download script here:
You do not have permission to view the full content of this post. Log in or register now.

How to use it on terminal?
  • make sure nakuha niyo na 'yung packages sa itaas (if you use termux, just "pkg install name_ng_dependency")
  • prepare your "single" java file kasama ng script
  • then run it:
bash term_java.sh *NameOfYourFile*.java

note: compiler lang 'to

edit: for machines na walang "java/javac" dependency na galing sa oracle, refer to #4 kung may dependency kayo niyan :)
 
Last edited:
may tutorial ka po ba about installing jdk at jre sa linux?
 
may tutorial ka po ba about installing jdk at jre sa linux?
alam ko provided ng oracle to sa website nila, dl mo na lang sa distro mo :) saka baka studio hanap mo, search for eclipse, intellij or kung saan ka magiging comfortable
 
All you need is this oneliner:

javac HelloWorld.java && java HelloWorld
hmm, tingin ko dapat ata itama thread ko haha, pang termux lang talaga 'to or sa mga terminal na wala pang support ng compiler ng oracle java, tho pwede naman humanap ng build, kaso may ecj naman kaya parang naging workaround lang rin to hehe :)
 
Back
Top