I tested against the standard hello.java and hello.c that comes with the gwan server running on Ubuntu 12.04 server. G-WAN 4.3.1 64-bit (Mar 1 2013 17:36:39)
Once I run gwan with
sudo ./gwan -d
I also noticed the same behavior running without the daemon option.
Then browse to 192.168.0.2:8080/?hello.c
I get the expected output of "Hello, ANSI C!". I change the text in hello.c and refresh the browser and get the expected changes.
If I do the same thing with the hello.java file, changes to the text do not appear until I restart gwan.
Does anyone know if I'm missing some simple setting that would cause a recompile any time the file is changed? I'm using OpenJdk 7. (just installed it on a fresh install of ubuntu 12.04) I even tried calling it like 192.168.0.2:8080/?hello.java&n=1 to eliminate cache possibilities, then another browser then another machine on a different network. Same thing, the changes just don't seem to happen until I restart the server. (for java, it worked fine with .c files)
Thanks
-Steve
解决方案
You are right. This is a long-standing unresolved issue because we did not find how to write and use a "JNI custom class loader", the way to unload and reload Java classes dynamically.
When we asked for assistance, some Java users redirected us to huge (hundreds of MBs) Java packages which support this feature but since this is merely a question of a few lines of JNI ANSI C code, we would like to implement it in the C G-WAN program itself (we just lack the JVM knowledge to do it).
Any help from the Java community would be much appreciated (contributors will receive credit where credit is due). We are still missing this Java feature.