Warning: this is an htmlized version!
The original is here, and the conversion rules are here. |
####### # # E-scripts about Java. # # Note 1: use the eev command (defined in eev.el) and the # ee alias (in my .zshrc) to execute parts of this file. # Executing this file as a whole makes no sense. # An introduction to eev can be found here: # # (find-eev-quick-intro) # http://angg.twu.net/eev-intros/find-eev-quick-intro.html # # Note 2: be VERY careful and make sure you understand what # you're doing. # # Note 3: If you use a shell other than zsh things like |& # and the for loops may not work. # # Note 4: I always run as root. # # Note 5: some parts are too old and don't work anymore. Some # never worked. # # Note 6: the definitions for the find-xxxfile commands are on my # .emacs. # # Note 7: if you see a strange command check my .zshrc -- it may # be defined there as a function or an alias. # # Note 8: the sections without dates are always older than the # sections with dates. # # This file is at <http://angg.twu.net/e/java.e> # or at <http://angg.twu.net/e/java.e.html>. # See also <http://angg.twu.net/emacs.html>, # <http://angg.twu.net/.emacs[.html]>, # <http://angg.twu.net/.zshrc[.html]>, # <http://angg.twu.net/escripts.html>, # and <http://angg.twu.net/>. # ####### # «.simple-programs» (to "simple-programs") # «.beanshell» (to "beanshell") # «.clojure» (to "clojure") # «.ditaa» (to "ditaa") # «.domino» (to "domino") # «.jasmin» (to "jasmin") # «.java-package» (to "java-package") # http://packages.debian.org/unstable/libs/sun-java5-jre # http://www.debian.org/doc/manuals/debian-java-faq/ch5.html # http://www.debian.org/doc/manuals/debian-java-faq/ch5.html#s-scsl # http://www.debian.org/doc/manuals/debian-java-faq/ch5.html#s-license-concerns # http://www.debian.org/doc/manuals/debian-java-faq/ch5.html#s-free # http://www.debian.org/doc/manuals/debian-java-faq/ch11.html#s-swing-run # http://www.debian.org/doc/manuals/debian-java-faq/index.html # http://www.debian.org/doc/manuals/debian-java-faq/ch-browser-java.html # http://wiki.debian.org/Java/MoveToMain # http://wiki.debian.org/Java/AlreadyMovedToMain # A note on demangling: # http://www.debian.org/doc/manuals/debian-java-faq/ch-browser-java.html * (eepitch-shell) c++filt -s gnu __vt_17nsGetServiceByCID # \-> nsGetServiceByCID virtual table objdump -R /usr/lib/libxpcom.so | grep nsGetServiceByCID # \-> 000ec114 R_386_GLOB_DAT _ZTV17nsGetServiceByCID c++filt -s gnu-v3 _ZTV17nsGetServiceByCID # \-> vtable for nsGetServiceByCID ##### # # simple programs # 2007nov20 # ##### # «simple-programs» (to ".simple-programs") # http://en.wikipedia.org/wiki/Java_%28programming_language%29 * (eepitch-shell) #* rm -Rv /tmp/java/ mkdir /tmp/java/ cd /tmp/java/ cat > Hello.java <<'%%%' // Hello.java public class Hello { public static void main(String[] args) { System.out.println("Hello, World!"); } } %%% cat > OddEven.java <<'%%%' // OddEven.java import javax.swing.JOptionPane; public class OddEven { private int input; public OddEven() { } public void showDialog() { input = Integer.parseInt(JOptionPane.showInputDialog("Please Enter A Number")); } public void calculate() { if (input % 2 == 0) System.out.println("Even"); else System.out.println("Odd"); } public static void main(String[] args) { OddEven number = new OddEven(); number.showDialog(); number.calculate(); } } %%% gcj Hello.java |& tee ogh gcj -c -v Hello.java |& tee ogch gcj -c -v OddEven.java |& tee ogcoe laf #* # (find-fline "/tmp/java/") # (find-fline "/tmp/java/ogh") # (find-fline "/tmp/java/ogch") # (find-fline "/tmp/java/ogcoe") # A problem: cat > Hello.java <<'%%%' // Hello.java public class Hello { public static void main(String[] args) { System.out.println("Hello, World!"); } } %%% gcj Hello.java /usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/crt1.o: In function `_start': ../sysdeps/i386/elf/start.S:115: undefined reference to `main' collect2: ld returned 1 exit status ##### # # beanshell # 2009jul20 # ##### # «beanshell» (to ".beanshell") # (find-es "openoffice" "beanshell") # (find-status "bsh") # (find-vldifile "bsh.list") # (find-udfile "bsh/") # (find-status "bsh-doc") # (find-vldifile "bsh-doc.list") # (find-udfile "bsh-doc/") # (find-udfile "bsh-doc/html/") # (find-udw3m "bsh-doc/html/index.html") # (find-udw3m "bsh-doc/html/quickstart.html") * (eepitch-bsh) * (eepitch-kill) * (eepitch-bsh) foo = "Foo"; four = (2 + 2)*2/2; print( foo + " = " + four ); // print() is a BeanShell command // Do a loop for (i=0; i<5; i++) print(i); // Pop up a frame with a button in it button = new JButton( "My Button" ); frame = new JFrame( "My Frame" ); frame.getContentPane().add( button, "Center" ); frame.pack(); frame.setVisible(true); ##### # # clojure # 2010dec03 # ##### # «clojure» (to ".clojure") # (find-es "clojure") # (find-status "clojure") # (find-vldifile "clojure.list") # (find-udfile "clojure/") # http://nakkaya.com/2010/12/02/a-simple-forth-interpreter-in-clojure/ * (eepitch-shell) * (eepitch-kill) * (eepitch-shell) rm -Rv /tmp/clojure/ mkdir /tmp/clojure/ unzip -d /tmp/clojure/ /usr/share/java/clojure-1.1.0.jar cd /tmp/clojure/ mv -v clojure/*.clj . rm -Rv /tmp/clojure/META-INF/ rm -Rv /tmp/clojure/clojure/ # (code-c-d "clojure" "/tmp/clojure/") # (find-clojurefile "") * (eepitch-shell) * (eepitch-kill) * (eepitch-shell) clojure -r (ns forth (:refer-clojure :exclude [pop!])) (declare forth-eval) (defn pop! [stack] (let [first (first @stack)] (swap! stack pop) first)) (defn push! [stack item] (swap! stack conj item)) (defn next-token [stream] (if (. stream hasNextBigInteger) (. stream nextBigInteger) (. stream next))) (defn init-env [] (let [stream (java.util.Scanner. System/in) stack (atom '()) dict (atom {}) prim (fn [id f] (swap! dict assoc id f))] (prim ".s" #(do (println "---") (doseq [s @stack] (println s)) (println "---"))) (prim "cr" #(println)) (prim "+" #(push! stack (+ (pop! stack) (pop! stack)))) (prim "*" #(push! stack (* (pop! stack) (pop! stack)))) (prim "/" #(let [a (pop! stack) b (pop! stack)] (push! stack (/ b a)))) (prim "-" #(let [a (pop! stack) b (pop! stack)] (push! stack (- b a)))) (prim "dup" #(push! stack (first @stack))) (prim "." #(println (pop! stack))) (prim ":" #(let [name (next-token stream) block (loop [b [] n (next-token stream)] (if (= n ";") b (recur (conj b n) (next-token stream))))] (prim name (fn [] (doseq [w block] (forth-eval dict stack w)))))) [dict stack stream])) (defn forth-eval [dict stack token] (cond (contains? @dict token) ((@dict token)) (number? token) (push! stack token) :default (println token "??"))) (defn repl [env] (let [[dict stack stream] env token (next-token stream)] (when (not= token "bye") (forth-eval dict stack token) (repl env)))) (repl (init-env)) 5 6 + 7 8 + * . cr 3 2 1 + * . cr : sq dup * ; 2 sq . bye # (find-fline "/usr/share/java/clojure-1.1.0.jar") # (find-udfile "clojure/copyright") # (find-udfile "clojure/readme.txt") # (find-udfile "clojure/changelog.gz") # (find-udfile "clojure/README.Debian") # (find-udfile "clojure/changelog.Debian.gz") # (find-man "1 clojurec") # (find-man "1 clojure-repl") # (find-man "1 clojure") # (find-fline "/usr/bin/clojure") # (find-fline "/usr/bin/clojure-repl") # (find-fline "/usr/bin/clojurec") # (find-fline "/usr/share/java/clojure.jar") # (find-fline "/usr/share/maven-repo/org/clojure/clojure/debian/clojure-debian.jar") # (find-fline "/usr/share/maven-repo/org/clojure/clojure/1.1.0/clojure-1.1.0.jar") # http://nakkaya.com/2010/01/09/a-simple-turtle-graphics-implementation-in-clojure/ # http://nakkaya.com/code/clojure/turtle.clj # (find-es "rubyforth") ##### # # ditaa # 2011jan08 # ##### # «ditaa» (to ".ditaa") # http://ditaa.sourceforge.net/ * (eepitch-shell) * (eepitch-kill) * (eepitch-shell) cd /tmp/ rm -Rv /tmp/ditaa/ mkdir /tmp/ditaa/ cd /tmp/ditaa/ rm -Rf ~/usrc/ditaa/ mkdir ~/usrc/ditaa/ mkdir ~/usrc/ditaa/ rm -Rv ~/usrc/ditaa/ cd ~/usrc/ svn co https://ditaa.svn.sourceforge.net/svnroot/ditaa ditaa tar -cvzf ~/tmp/ditaa.tgz ditaa/ rm -Rv /tmp/ditaa/ mkdir /tmp/ditaa/ cd /tmp/ditaa/ ##### # # Domino # 2011oct20 # ##### # «domino» (to ".domino") # http://en.wikipedia.org/wiki/Natural_deduction # http://www.winterdrache.de/freeware/domino/ # http://nddomino.sourceforge.net/Domino.jar * (eepitch-shell) * (eepitch-kill) * (eepitch-shell) cd $S/http/nddomino.sourceforge.net/ java -jar Domino.jar ##### # # Jasmin # 2012jan23 # ##### # «jasmin» (to ".jasmin") # (find-zsh "availabledebs | sort | grep jasmin") # (find-status "jasmin-sable") # (find-vldifile "jasmin-sable.list") # (find-udfile "jasmin-sable/") # (find-udfile "jasmin-sable/examples/ANewArray.j") http://asm.ow2.org/ ##### # # java-package # 2015apr27 # ##### # «java-package» (to ".java-package") # (find-status "java-package") # (find-vldifile "java-package.list") # (find-udfile "java-package/") # (find-zsh "installeddebs | sort | grep java") # (find-zsh "availabledebs | sort | grep java") # https://wiki.debian.org/JavaPackage # https://wiki.debian.org/JavaPackage # https://packages.debian.org/openjdk-7-jre # https://packages.debian.org/openjdk-7-jdk # https://packages.debian.org/sun-java6-jre # https://packages.debian.org/sun-java6-jdk # http://sylvestre.ledru.info/blog/2011/08/26/sun_java6_packages_removed_from_debian_u # http://www.java.com/pt_BR/download/linux_manual.jsp?locale=pt_BR # http://javadl.sun.com/webapps/download/AutoDL?BundleId=106238 # 2015apr30: # http://ftp.debian.org/debian/pool/contrib/j/java-package/ # http://ftp.debian.org/debian/pool/contrib/j/java-package/java-package_0.56.dsc # http://ftp.debian.org/debian/pool/contrib/j/java-package/java-package_0.56.tar.xz # http://ftp.debian.org/debian/pool/contrib/j/java-package/java-package_0.56_all.deb * (eepitch-shell) * (eepitch-kill) * (eepitch-shell) # (find-man "1 make-jpkg") cd /tmp/ laf jre-8* make-jpkg jre-8* laf sudo dpkg -i oracle-java8-jre*.deb # (find-status "oracle-java8-jre") # (find-vldifile "oracle-java8-jre.list") # (find-udfile "oracle-java8-jre/") The build system used is based on Make, not Gradle. Gradle has the nasty habit of automatically downloading software you did not ask for. https://lists.gnu.org/archive/html/emacs-devel/2023-06/msg00368.html https://en.wikipedia.org/wiki/Gradle https://tonsky.me/blog/skija/ Graphics for JVM https://blog.notroot.online/posts/blogging-with-emacs:-bells-and-whistles/ ditaa libnpjp2.so # (find-zsh "dmissing libnpjp2.so") ;; (find-status "sun-java6-bin") ;; (find-vldifile "sun-java6-bin.list") ;; (find-udfile "sun-java6-bin/") # Local Variables: # coding: utf-8-unix # End: