Top.Mail.Ru
April 27th, 2006 - Java developers — LiveJournal
? ?

Java developers

April 27th, 2006

07:20 pm - banana - Obfuscation

You may be familiar with the International Obfuscated C Code Contest. I could not find anything similar for Java, but I did find a couple of nice examples involving abuse of Unicode escapes and abuse of variable names, shift operators and layout. Despite their age, I had little trouble compiling and running both examples. Save the first one as h.java (yes, lower case h). The second one has HTML entities that you need to unescape (e.g. change &lt; to <, etc.) and you can take out blank lines for the full effect.

So, do the members of this community want to have a go at bettering those examples? If so, I'll knock up some rules we'll see what people come up with.

Poll #718122 Obfuscated Java

Should java_dev have an obfuscated Java contest?

Yes
11(64.7%)
No
6(35.3%)

08:49 pm - bsdcat - J2ME, Wireless Toolkit

I'm not new to Java, but I am new to J2ME, and I'm trying to install Sun's Wireless Toolkit in order to progress past reading about it.

First step is selecting a JDK to use during installation, and I'm using 1.5.0_06 (I've tried others, including 1.4.2_mumble) - the install process finds that installation handily. But when I click the button to use that JDK, I immediately get the error, "Could not find the main class. Program will exit."

That error is pretty clear, but how to fix it is not in this case. I haven't played any games with my CLASSPATH, and aside from installing and uninstalling a couple different JDK versions I haven't done anything else, knowingly, to my system that would effect running Java programs (Applets work fine in my browser, and JARs run from the command line). There are no exotic system requirements, and the classes that should be running (I presume) are packed away in the installer.

Any ideas on how to proceed? My best guess is extracting the files in the installer, but I'm not familiar with how I might do that on Windows.

Result of java -version:
C:\>java -version
java version "1.5.0_06"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05)
Java HotSpot(TM) Client VM (build 1.5.0_06-b05, mixed mode)

09:13 pm - naoe_riki - Garbage Collector: Dealing with circular references

To me this seems to be the most appropriate place in LJ to post this question, so here it goes:

Garbage Collector in Java. How does it actually deal with circular references? You know, circular references is what makes it impossible for GC to operate only by storing the number of references to each object. So I suppose there is some other way.. Well, imagine two objects "containing each other" (is that possible?) and no other objects, and forced to be deleted together with the other object when it is deleted.

If not permitted to mark an object as "to-be-deleted", exactly how does the Java Garbage Collector operate in this case?
Powered by LiveJournal.com