Showing posts with label Java. Show all posts
Showing posts with label Java. Show all posts

Sunday, December 19, 2010

How to install Sun JDK on Ubuntu 10.10 “Maverick meerkat”?

Surprised to find that Sun Java packages were missing in Ubuntu Maverick (10.10). The new Ubuntu release uses OpenJDK by default. I needed sun-java6-jdk package to use a eclipse IDE development Android ADT plugin.

Found the solution in this StackOverFlow thread How to install Sun JDK on Ubuntu 10.10 “Maverick meerkat”?


# Add this line to your /etc/apt/sources.list file
deb http://archive.canonical.com/ubuntu maverick partner

sudo apt-get update

sudo apt-get install sun-java6-jdk 

# Get rid of OpenJDK 
sudo apt-get remove openjdk-6-jdk openjdk-6-jre openjdk-6-jre-headless openjdk-6-jre-lib 



Friday, December 19, 2008

Open Office.org Annoyances, Needs Java

This is perhaps the most annoying thing about Open Office.org. Why do I need Java Runtime for OpenOffice to export a document into HTML format. Duh!

OpenOffice.org writer demanding java run time envirnoment ooffice why-fs.odt javaldx: Could not find a Java Runtime Environment!

I know I heard about the Ooffice Java Controversy but do you think its a sound technical design to use Java for doing a simple thing like htmlizing a document.

Saturday, May 31, 2008

Stanford Parser Gotcha

I have aged 6 years since I last coded in Java. So I wasn't quite sure what to make of this Stanford Parser error in the NLP summer school lab. For a while I was quite sure that I didn't set the Java CLASSPATH properly and thus the parser is spewing blood and gore all over me. But after a hour of mucking around I realised that it wasn't so. The real problem seems to that the parser doesn't seem to run well with gij .

$ gij --version gij (GNU libgcj) version 3.4.6 20060404 (Red Hat 3.4.6-3)

$ ./lexparser.csh Warning: -server not understood. Ignoring. Warning: -mx150m not understood. Ignoring. Exception in thread "main" java.lang.ClassFormatError: edu.stanford.nlp.parser.lexparser.LexicalizedParser (erroneous method access flags) at _Jv_ClassReader.throw_class_format_error(byte) (/usr/lib/libgcj.so.5.0.0) at _Jv_ClassReader.handleMethod(int, int, int, int) (/usr/lib/libgcj.so.5.0.0) at _Jv_ClassReader.read_methods() (/usr/lib/libgcj.so.5.0.0) at _Jv_ClassReader.parse() (/usr/lib/libgcj.so.5.0.0) at _Jv_DefineClass(java.lang.Class, byte[], int, int) (/usr/lib/libgcj.so.5.0.0) at java.lang.VMClassLoader.defineClass(java.lang.ClassLoader, java.lang.String, byte[], int, int, java.security.ProtectionDomain) (/usr/lib/libgcj.so.5.0.0) at java.lang.ClassLoader.defineClass(java.lang.String, byte[], int, int, java.security.ProtectionDomain) (/usr/lib/libgcj.so.5.0.0) at java.security.SecureClassLoader.defineClass(java.lang.String, byte[], int, int, java.security.CodeSource) (/usr/lib/libgcj.so.5.0.0) at java.net.URLClassLoader.findClass(java.lang.String) (/usr/lib/libgcj.so.5.0.0) at gnu.gcj.runtime.VMClassLoader.findClass(java.lang.String) (/usr/lib/libgcj.so.5.0.0) at java.lang.ClassLoader.loadClass(java.lang.String, boolean) (/usr/lib/libgcj.so.5.0.0) at _Jv_FindClass(_Jv_Utf8Const, java.lang.ClassLoader) (/usr/lib/libgcj.so.5.0.0) at java.lang.Class.forName(java.lang.String, boolean, java.lang.ClassLoader) (/usr/lib/libgcj.so.5.0.0) at java.lang.Class.forName(java.lang.String) (/usr/lib/libgcj.so.5.0.0) at gnu.gcj.runtime.FirstThread.run() (/usr/lib/libgcj.so.5.0.0) at _Jv_ThreadRun(java.lang.Thread) (/usr/lib/libgcj.so.5.0.0) at _Jv_RunMain(java.lang.Class, byte const, int, byte const, boolean) (/usr/lib/libgcj.so.5.0.0) at __gcj_personality_v0 (/home/iasnlp2008/Desktop/stanford-parser-2007-08-19/java.version=1.4.2) at __libc_start_main (/lib/tls/libc-2.3.4.so) at _Jv_RegisterClasses (/home/iasnlp2008/Desktop/stanford-parser-2007-08-19/java.version=1.4.2)

To test my hunch I changed machines and tried with other version of Java (viz 1.5.x) and it worked without a breaking a sweat. Except for the minor problems like this mistake in script the exparser-gui.csh on line $scriptdir/stanford-parser.jar: everything seems to be alright so far.

$ java -version java version "1.5.0_05" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05) Java HotSpot(TM) Server VM (build 1.5.0_05-b05, mixed mode)

Popular Posts