|
Warning: this is an htmlized version!
The original is across this link, 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.
#
# 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")
# 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-shell)
* (eepitch-kill)
* (eepitch-shell)
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);
# Local Variables:
# coding: raw-text-unix
# ee-delimiter-hash: "\n#*\n"
# ee-delimiter-percent: "\n%*\n"
# ee-anchor-format: "«%s»"
# End: