Java static imports no longer work
This example no longer works:
import static Graphics.*;
public class JavaGraphics {
public static void main(String[] args) {
WindowClass window = Window("Testing", 400, 100);
}
}
JavaGraphics.main(new String[0]);
Error message:
Run filename '/home/dblank/Calico/languages/Java/examples/JavaGraphics.java'!
tried to access class cli.Graphics$$$003CShow$$003Ec__AnonStoreyA from class cli.Graphics
Maybe we just need to rewrite it without the static imports.
Comments (27)
-
reporter -
Let me try recreating the *.jar files with my version of ikvm and see if the issue persists. How do you create the jar files again?
-
reporter There is a makefile in the languages/Java/jar file. But I already did that. In fact, I did that before I tested, so that probably caused the problem.
-
But I used the ikvm-fork version of ikvm, remember? I tried building the jar, but ran into a .net 2.0 vs. 4.0 snafu:
ikvmstub.exe -lib:../../../bin/ -lib:/usr/lib/cli/gtk-sharp-2.0/ -lib:/usr/lib/cli/glib-sharp-2.0/ -lib:/usr/lib/cli/atk-sharp-2.0/ -lib:/usr/lib/cli/gdk-sharp-2.0/ -lib:/usr/lib/cli/pango-sharp-2.0/ ../../../modules/Common.dll Error: unable to load assembly '../../../modules/Common.dll' as it depends on a higher version of mscorlib than the one currently loaded
-
reporter Does that mean that we can't just run make? Can you put additional instructions in that directory? Should we include the mono IKVM in Calico git?
-
Well you can run make but odds are you will be running a different version of ikvm. I'll add a README with a link to the proper version.
What do you make of this .Net 4.0 vs. 2.0 problem. Do the modules really need 4.0? I'm totally ignorant of the differences. Except for 4.0 broke ROS support on Windows and Mac OS X.
-
reporter I am ignorant as well. I think that I broke F# and C# in this same manner. I'm going to try to go back to previous versions of both.
If the IKVM files are cross-domain, we can just add them to the repository. I think we already have some in languages/Java/lib
-
reporter Can you rebuild the libraries and see if that fixes the issue?
-
I was able to rebuild Graphics and Myro using sdk:2 and they seem OK. I'm having trouble rebuilding Common though.
-
reporter Wait, you have to rebuild the modules/*.dll, just for use in Java? Maybe we can use copies of the DLLs compiled for Java? I would hate to make such a major change minutes before releasing...
-
I'm trying to rebuild modules. But I'm getting caught on Common, I'm wrestling with monodevelop to make it use 2.0 rather than 4.0. The other modules have Makefiles I can easily edit.
I was unable to run ikvmstub on the dll's because of an mscor mismatch.
-
OK, I won't rebuild those then. I think we should get this java stuff figured out before the release. What's the rush?
-
I figured out how to rebuild the jar's from dll's and force 4.0 version of mscorlib.
-
reporter Ok, that is very good. I was tracking down some esoteric things that weren't working. But the updated libraries made them work again. So, ok!
-
reporter This issue is resolved!
-
How'd you fix it?
-
reporter I think when you replaced the jar files, it started working again.
-
I just finished replacing the jars in java/jars now (they werent' checked in!). I was having trouble rebuilding them with the 2.0 ikvm.
-
I'm still getting the java error:
Run filename '/home/keithohara/gitCalico/languages/Java/examples/JavaGraphics.java'! tried to access class cli.Graphics$$$003CShow$$003Ec__AnonStoreyA from class cli.Graphics
-
reporter I must have been mistaken... I was going back to previous versions using "git checkout XXXX" and something must have been from the older version. I get the error again.
-
reporter -
reporter My git advice is wrong... it only pulls out particular changes. Do you know how to put yourself back at a point in the git tree?
-
I thought git checkout was the correct way to do this.
-
reporter I thought so, but if you look at the files, some of them are from later versions...
-
- changed status to resolved
A new set of .jar and dll based on ikvm-7.2.4630.5 - this fixes the java module problem with ROS stil running. Fixes Issue 27.
→ <<cset 98f52b81f380>>
-
reporter Looks good to me on all platforms. Great work!
-
reporter -
assigned issue to
-
assigned issue to
- Log in to comment
This may have to do with having $ in names. From the calico-dev mailing list, some hints: