- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
jdk6 javac cannot process scala generated classfiles
Sun, 2010-03-21, 05:18
The jdk6 compiler is sometimes used to process compiled classfiles as in
javac -Xprint mypkg.Myclass
javac -proc:only -Xlint:-processing -processor MyProcessor mypkg.Myclass
However if I try this with Scala classfiles I get
+++++++++++++++++++++++++++++++++++++++++++++++++
error: cannot access mypkg.MyClass.$anon$4
bad class file: mypkg/MyClass$$anon$4.class
undeclared type variable: A
Please remove or make sure it appears in the correct subdirectory of
the classpath.
+++++++++++++++++++++++++++++++++++++++++++++++++
Is there a way to make this work? I need to be able to post-process
Scala classfiles
in order to use scala in a Java based project.
thanks
Daniel
Mon, 2010-03-22, 00:37
#2
Re: jdk6 javac cannot process scala generated classfiles
On Sun, Mar 21, 2010 at 9:42 AM, Ismael Juma wrote:
> On Sun, Mar 21, 2010 at 4:18 AM, Daniel Mahler wrote:
>> Is there a way to make this work? I need to be able to post-process
>> Scala classfiles
>
> You have to provide more details, starting with the Scala version
> you're using. If it's 2.7.x, try with 2.8.0.Beta1 and/or nightly. If
> the latter, then steps to reproduce with a small example would help in
> a resolution (assuming that a bug for it doesn't already exist in
> trac).
Sorry, it was late ...
I am using 2.8.0.r21010-b2010022802013
The problem can be reproduced on the scala libraries. eg:
+++++++++++++++++++++++++++++++++++++++++++++++++++++++
$ javac -cp scala-library.jar -Xprint scala.actors.Actor
error: cannot access scala.actors.Actor.$anonfun$receiveWithin$1
class file for scala.actors.Actor$$anonfun$receiveWithin$1 not found
1 error
+++++++++++++++++++++++++++++++++++++++++++++++++++++++
thanks
Daniel
> Best,
> Ismael
>
On Sun, Mar 21, 2010 at 4:18 AM, Daniel Mahler wrote:
> Is there a way to make this work? I need to be able to post-process
> Scala classfiles
You have to provide more details, starting with the Scala version
you're using. If it's 2.7.x, try with 2.8.0.Beta1 and/or nightly. If
the latter, then steps to reproduce with a small example would help in
a resolution (assuming that a bug for it doesn't already exist in
trac).
Best,
Ismael