Community
Participate
Working Groups
I need to include some jar file into a project. That jar contains only .class files - some are in the default package and some are in subpackages. In my code, classes which are in a subpackage can be found. The classes in the default package can, so thinks eclipse, not be resolved. I'm running the M4 build of the 3.0 eclipse (200310101454) under winxp here. On a different system with eclipse 2.1 (200302211557) under w2k, everything works fine, all symbols can be resolved. The project configuration is in both eclipse version, as far as I can tell, the same.
Created attachment 6837 [details] The jar file in question In the code, the classes FlexibleConstants, FlexibleConstraints, FlexibleLayout cannot be resolved. ptolemy.plot.Plot works fine
3.0 M4 is defaulting to compiler 1.4 compliant mode, whereas 2.1.1 defaults to 1.3 compiler compliant mode. In 1.4, the default package is no longer accessible from the outside. This is a language evolution.
I'm sorry, there's one thing I forgot to mention: in both configurations, eclipse was told to use a 1.1.7 jdk (it's an applet and everyone should be able to run it, even with the ms-jvm).
What are your compliance settings? Go to Preferences>Java>Compiler>Compliance and Classfiles. If this is 1.4, you need to change it to 1.3.
To clarify. Eclipse uses its own compiler which can be configured to either perform as a 1.3 or 1.4 compiler. If you want to compile your code against a JDK1.1.7, this should work fine as long as you ensure the .class file compliance level is set to 1.1 (under Preferences>Java>Compiler>Compliance and Classfiles). If you also want to be able to compile against classes in default package, then you also need to turn the compiler compliance to 1.3, since as I said in previous comment, the language got changed around 1.4 so as to disallow these type of accesses. Is it ok to close ?
Changing the Compiler compliance level solved the problem. Thanks for your help
Should have been closed as workforme.
Closing