Anyhow I'm running jdk 5.0 here and log4j fails to compile because internally a variable enum is being used which also is a keyword since jdk 5.0. See http://java.sun.com/j2se/1.5.0/docs/guide/language/enums.html or http://java.sun.com/j2se/1.5.0/docs/relnotes/features.html#enums The fix is simple since the compile flags as suggested by the compiler or alter to code not to use enum as a veriable anymore. (There are more errors, all are alike but I copy pasted only the beginning and the end). >>> emerge (1 of 1) dev-java/log4j-1.2.8-r2 to / >>> md5 src_uri ;-) jakarta-log4j-1.2.8.tar.gz >>> Unpacking source... >>> Unpacking jakarta-log4j-1.2.8.tar.gz to /var/tmp/portage/log4j-1.2.8-r2/work tar: A lone zero block at 17013 >>> Source unpacked. Buildfile: build.xml init: build.core: [mkdir] Created dir: /var/tmp/portage/log4j-1.2.8-r2/work/jakarta-log4j-1.2. 8/dist/classes [javac] Compiling 160 source files to /var/tmp/portage/log4j-1.2.8-r2/work/j akarta-log4j-1.2.8/dist/classes [javac] /var/tmp/portage/log4j-1.2.8-r2/work/jakarta-log4j-1.2.8/src/java/or g/apache/log4j/Category.java:207: as of release 1.5, 'enum' is a keyword, and ma y not be used as an identifier [javac] (try -source 1.4 or lower to use 'enum' as an identifier) [javac] Enumeration enum = this.getAllAppenders(); [javac] ^ [javac] /var/tmp/portage/log4j-1.2.8-r2/work/jakarta-log4j-1.2.8/src/java/or g/apache/log4j/Category.java:208: as of release 1.5, 'enum' is a keyword, and may not be used as an identifier [javac] (try -source 1.4 or lower to use 'enum' as an identifier) [javac] Thread t = (Thread) enum.nextElement(); [javac] ^ [javac] /var/tmp/portage/log4j-1.2.8-r2/work/jakarta-log4j-1.2.8/src/java/or g/apache/log4j/PropertyConfigurator.java:511: as of release 1.5, 'enum' is a key word, and may not be used as an identifier [javac] (try -source 1.4 or lower to use 'enum' as an identifier) [javac] Enumeration enum = props.propertyNames(); [javac] ^ [javac] /var/tmp/portage/log4j-1.2.8-r2/work/jakarta-log4j-1.2.8/src/java/or g/apache/log4j/PropertyConfigurator.java:512: as of release 1.5, 'enum' is a key word, and may not be used as an identifier [javac] (try -source 1.4 or lower to use 'enum' as an identifier) [javac] while(enum.hasMoreElements()) { [javac] ^ [javac] /var/tmp/portage/log4j-1.2.8-r2/work/jakarta-log4j-1.2.8/src/java/or g/apache/log4j/PropertyConfigurator.java:513: as of release 1.5, 'enum' is a key word, and may not be used as an identifier [javac] (try -source 1.4 or lower to use 'enum' as an identifier) [javac] String key = (String) enum.nextElement(); [javac] ^ [javac] /var/tmp/portage/log4j-1.2.8-r2/work/jakarta-log4j-1.2.8/src/java/or g/apache/log4j/lf5/viewer/categoryexplorer/CategoryNodeEditor.java:244: as of re lease 1.5, 'enum' is a keyword, and may not be used as an identifier [javac] (try -source 1.4 or lower to use 'enum' as an identifier) [javac] Enumeration enum = root.depthFirstEnumeration(); [javac] ^ [javac] /var/tmp/portage/log4j-1.2.8-r2/work/jakarta-log4j-1.2.8/src/java/or g/apache/log4j/lf5/viewer/categoryexplorer/CategoryNodeEditor.java:245: as of re lease 1.5, 'enum' is a keyword, and may not be used as an identifier [javac] (try -source 1.4 or lower to use 'enum' as an identifier) [javac] while (enum.hasMoreElements()) { [javac] ^ [javac] /var/tmp/portage/log4j-1.2.8-r2/work/jakarta-log4j-1.2.8/src/java/or g/apache/log4j/lf5/viewer/categoryexplorer/CategoryNodeEditor.java:246: as of re lease 1.5, 'enum' is a keyword, and may not be used as an identifier [javac] (try -source 1.4 or lower to use 'enum' as an identifier) [javac] CategoryNode node = (CategoryNode) enum.nextElement(); [javac] ^ [javac] 13 errors BUILD FAILED /var/tmp/portage/log4j-1.2.8-r2/work/jakarta-log4j-1.2.8/build.xml:188: Compile failed; see the compiler error output for details. Total time: 4 seconds !!! ERROR: dev-java/log4j-1.2.8-r2 failed. !!! Function src_compile, Line 36, Exitcode 1 !!! compilation error !!! If you need support, post the topmost build error, NOT this status message. Reproducible: Always Steps to Reproduce: The jdk i'm using according to genlop: Thu Oct 7 15:01:20 2004 >>> dev-java/sun-jdk-1.5.0 Or according to java -version: java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64) Java HotSpot(TM) 64-Bit Server VM (build 1.5.0-b64, mixed mode) This is a amd64 machine but this is non significant for this package.
that's not the only problem. i tried to add source and target attributes to the javac notes but it still failed. will try to figure out why this happens later.
Created attachment 44695 [details] A new ebuild has fixed the compilation on java 5.0 The basic packages of log4j 1.2.9 compile with java 5.0 with this ebuild. Unfortunately it now detects that jmx is in use even though I have -jmx in USE (the java 5.0 includes jmx) because the build.xml checks for the wrong class. I changed the ebuild to alter the build.xml so that the compilation of the jmx subpackage depends on internal sun classes that the code actually requires not on some generic jmx class that comes with the java 5.0.
not fixed with new ebuild. i tried with or without jmx flag, nothing changed. continues to be broken
no news? it locks lots of packages, eclipse too!
uu sorry! using: USE="-jikes -doc -javamail -jmx -jms" emerge log4j fixed the problem. ok :)
I can't get this packet to compile either... Even USE="-jikes -doc -javamail -jmx -jms" emerge log4j fail because of jmx being detected. . . jmx: [echo] JMX is present. build.jmx: [javac] Compiling 7 source files to /var/tmp/portage/log4j-1.2.9/work/logging-log4j-1.2.9/dist/classes [javac] /var/tmp/portage/log4j-1.2.9/work/logging-log4j-1.2.9/src/java/org/apache/log4j/jmx/Agent.java:7: package com.sun.jdmk.comm does not exist [javac] import com.sun.jdmk.comm.HtmlAdaptorServer; [javac] ^ [javac] /var/tmp/portage/log4j-1.2.9/work/logging-log4j-1.2.9/src/java/org/apache/log4j/jmx/Agent.java:24: cannot find symbol [javac] symbol : class HtmlAdaptorServer [javac] location: class org.apache.log4j.jmx.Agent [javac] HtmlAdaptorServer html = new HtmlAdaptorServer(); [javac] ^ [javac] /var/tmp/portage/log4j-1.2.9/work/logging-log4j-1.2.9/src/java/org/apache/log4j/jmx/Agent.java:24: cannot find symbol [javac] symbol : class HtmlAdaptorServer [javac] location: class org.apache.log4j.jmx.Agent [javac] HtmlAdaptorServer html = new HtmlAdaptorServer(); [javac] ^ [javac] /var/tmp/portage/log4j-1.2.9/work/logging-log4j-1.2.9/src/java/org/apache/log4j/jmx/AppenderDynamicMBean.java:233: warning: non-varargs call of varargs method with inexact argument type for last parameter; [javac] cast to java.lang.Object for a varargs call [javac] cast to java.lang.Object[] for a non-varargs call and to suppress this warning [javac] return mu.readMethod.invoke(appender, null); [javac] ^ [javac] /var/tmp/portage/log4j-1.2.9/work/logging-log4j-1.2.9/src/java/org/apache/log4j/jmx/LayoutDynamicMBean.java:180: warning: non-varargs call of varargs method with inexact argument type for last parameter; [javac] cast to java.lang.Object for a varargs call [javac] cast to java.lang.Object[] for a non-varargs call and to suppress this warning [javac] return mu.readMethod.invoke(layout, null); [javac] ^ [javac] Note: Some input files use unchecked or unsafe operations. [javac] Note: Recompile with -Xlint:unchecked for details. [javac] 3 errors [javac] 2 warnings BUILD FAILED /var/tmp/portage/log4j-1.2.9/work/logging-log4j-1.2.9/build.xml:261: Compile failed; see the compiler error output for details. Total time: 6 seconds !!! ERROR: dev-java/log4j-1.2.9 failed. !!! Function src_compile, Line 36, Exitcode 1 !!! compilation error I'm using "Sun JDK 1.5.0"
*** Bug 74187 has been marked as a duplicate of this bug. ***
*** Bug 73183 has been marked as a duplicate of this bug. ***
I managed to successfully compile log4j-1.2.9 with JDK 1.5 by emerging JMX. It seems JMX has become a dependency instead of an optional package?
*** Bug 77602 has been marked as a duplicate of this bug. ***
closing this one because all 'not working with jdk 1.5' are now tracked in #79206: http://bugs.gentoo.org/show_bug.cgi?id=79206