[
https://issues.apache.org/jira/browse/DERBY-5125?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Knut Anders Hatlen updated DERBY-5125:
--------------------------------------
Attachment: javacc5.diff
Hi Zied,
Thanks for doing this work. Packaging up Derby for inclusion in Debian sounds
like a good way to make it more easily available for many users.
I downloaded JavaCC 5 and got Derby to build with it. Note that it's completely
untested for now, but at least it compiles.
There are two issues with JavaCC 5:
- The default JDK level changed from 1.4 to 1.5 so that the generated parser
uses generics. Since Derby compiles most of the code with source/target level
1.4 to make the binaries compatible with older JVMs, it fails to compile code
that uses generics. JavaCC has a flag to change the JDK level back to 1.4.
- The generated file Token.java changed. Derby has made some modifications to
Token.java and checked it into the repository, and now it needs to be
regenerated and updated with the Derby-specific changes. Good news is that
JavaCC has introduced a new option to allow specifying a parent class for the
generated Token class, so now we can customize it without actually having
Token.java checked into the repository.
So, here's what I did to get it to compile with JavaCC 5:
1) Replaced tools/java/javacc.jar with JavaCC version 5
2) Deleted the file java/engine/org/apache/derby/impl/sql/compile/Token.java
3) Applied the attached patch (javacc5.diff)
4) ant clobber && ant all
> Derby 10.7.1.1 : Build fails with javacc 5 (for Debian packaging)
> -----------------------------------------------------------------
>
> Key: DERBY-5125
> URL: https://issues.apache.org/jira/browse/DERBY-5125
> Project: Derby
> Issue Type: Improvement
> Components: SQL
> Affects Versions: 10.7.1.1
> Environment: Debian Linux Linux inf-7590.int-evry.fr 2.6.32-5-amd64
> #1 SMP Wed Jan 12 03:40:32 UTC 2011 x86_64 GNU/Linux
> java -version (also tested with sun jvm)
> java version "1.6.0_18"
> OpenJDK Runtime Environment (IcedTea6 1.8.7) (6b18-1.8.7-2)
> OpenJDK 64-Bit Server VM (build 16.0-b13, mixed mode)
> ant -version
> Apache Ant version 1.8.0 compiled on March 11 2010
> Reporter: Zied ABID
> Priority: Blocker
> Labels: build, libtool
> Fix For: 10.7.1.1, 10.7.1.3, 10.8.0.0, 11.0.0.0
>
> Attachments: javacc5.diff
>
>
> I try to and Apache derby into Debian, so I begin to compile derby
> sources [1], derby sources provide each own libs and javacc is one of
> them. In Debian, javacc version is 5.0 [2].
> After some tries, I'm in a this situation : compilation success with the
> official [3] javacc 4.0 and fail with the 5.0 official one.
> I think that is related with javacc options passed in .jj files
> (ex. java/engine/org/apache/derby/impl/sql/compile/sqlgrammar.jj lines 2-14)
> I don't know much about javacc, so I can't resolve unless modifying
> options blindly and I'm afraid that isn't enough ...
> Best regards,
> Zied
> [1] http://svn.apache.org/repos/asf/db/derby/code/tags/10.7.1.1/
> [2] http://packages.debian.org/squeeze/javacc
> [3] http://java.net/projects/javacc/downloads
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira