Thread: formatting..
View Single Post
  #11 (permalink)  
Old 01-07-2008, 09:51 AM
Schmidty Schmidty is offline
Member
 
Join Date: Jan 2008
Posts: 1
Schmidty is on a distinguished road
Javac link bad in Ubuntu Linux
All Ubuntu users who upgrade to Java 6 need to check their javac compiler link as it is still pointing to the Java 1.4 if they didn't install the Java source. I noticed this when I did a check on my system and was having a problem compiling a 'System.out.format()' and couldn't figure out why I was getting the following error;

Format.java:33: cannot resolve symbol
symbol : method format (java.lang.String,java.util.Calendar)
location: class java.io.PrintStream
System.out.format("Local time: %tT", Calendar.getInstance());

Check your links in Ubuntu;

schmidty@laptop:~/java_work$ ls -alh /etc/alternatives/javac
lrwxrwxrwx 1 root root 27 2007-12-20 18:17 /etc/alternatives/javac -> /usr/lib/j2se/1.4/bin/javac
schmidty@laptop:~/java_work$ ls -alh /etc/alternatives/java
lrwxrwxrwx 1 root root 36 2007-12-20 18:22 /etc/alternatives/java -> /usr/lib/jvm/java-6-sun/jre/bin/java
schmidty@laptop:~/java_work$ ls -alh /etc/alternatives/javac
lrwxrwxrwx 1 root root 33 2008-01-06 22:42 /etc/alternatives/javac -> /usr/lib/jvm/java-6-sun/bin/javac
schmidty@laptop:~/java_work$ ls -alh /etc/alternatives/java
lrwxrwxrwx 1 root root 36 2007-12-20 18:22 /etc/alternatives/java -> /usr/lib/jvm/java-6-sun/jre/bin/java

Again, the solution would be to install the source for Java6 in Ubuntu.

Schmidty
Reply With Quote