Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jdt-dev] ECJ not finding java.lang.String etc

Please file a bug for jdt core with steps to reproduce and small self contained code example that fails to compile.

Am 31. Oktober 2021 02:32:46 MEZ schrieb Stefan Reich via jdt-dev <jdt-dev@xxxxxxxxxxx>:
>Version without reflection for readability. But it's nothing anyway, I
>just run the main class
>
>
>import org.eclipse.jdt.internal.compiler.batch.*;
>Main main = new Main(printWriter, printWriter, false);
>main.compile(args);
>int errors = main.globalErrorsCount;
>
>
>On Sun, 31 Oct 2021 at 02:26, Stefan Reich <
>stefan.reich.maker.of.eye@xxxxxxxxxxxxxx> wrote:
>
>> The type java.lang.String cannot be resolved. It is indirectly referenced from required .class file
>>
>>
>> Any idea off the top of your head? Problem did not exist before ECJ
>> upgrade (from 4.19). This is what I do:
>>
>> Class ecjClass = Class.forName("org.eclipse.jdt.internal.compiler.batch.Main");
>> Object main = newInstance(ecjClass, printWriter, printWriter, false);
>> call(main, "compile", new Object[]{args});
>> int errors = (Int) get(main, "globalErrorsCount");
>>
>>
>> The helper methods (newInstance, call, get) just invoke stuff by
>> reflection in an obvious way.
>>
>> I can supply the options passed to ecj if that is of concern?
>>
>> Please advice
>>
>> Thank you
>> Stefan Reich
>>
>> --
>> == https://Gaz.AI/who+are+you ==
>>
>
>

--
Kind regards,
Andrey Loskutov

https://www.eclipse.org/user/aloskutov
Спасение утопающих - дело рук самих утопающих


Back to the top