StringProvider cannot be resolved to a typeParser.java

guyuming shared this question 2 months ago
Answered

i got the same error as described in https://help.geogebra.org/topic/get-some-errors-when-compile-geogebra-source


the original poster there said the problem solved by "I have solved this problem by updating javacc 5.0 to javacc 7.0, the StringProvider only exists javacc 6+"


90e67fe0d138388f8e3621add7c48cd4


I am new to java, and does not know how to upgrade the eclipse java plugin. Anyway, i found a workaround: i just downloaded javacc-7.0.9.jar , replace the /home/guyuming/.p2/pool/plugins/sf.eclipse.javacc_1.5.33/jars/javacc-5.0.jar with the downloaded one. And import the gradle project again. but it does not work. I should have taken a screenshot.


And i found there is a file /home/guyuming/.p2/pool/plugins/sf.eclipse.javacc_1.5.33/jars/javacc-6.0.jar, I rename it to javacc-5.0.jar, and import the gradle project again. Still not work. You can see in the screenshot that although the file name javacc-5.0.bar, it says "Java Compiler Compiler version 6.0_1"


by the way, I don't even know how to make the javacc run again after a replacing the file, anyway, i use a virtual machine and i can revert to original state and try again.

Comments (3)

photo
1

made some progress but problem still not resolved:


1. in Eclipse, project->clean menu will delete the .java files for .jj file and recreate them again.


2. with javacc-7.0.9.jar, StringProvider.java will be created for the common package, but it will not be created for the editor-base package.

photo
1

6e9a64f4c074da613f23e86e25b28381

photo
1

finally solved this issue:


i should not install the javacc plugin for eclipse, build.gradle in common folder already has 'ca.coglinc.javacc' version '2.4.0' configured.


so, i uninstalled the javacc plugin for eclipse. delete the .java files for the .jj files created before manually.


And then run ./gradew clean

./gradlew :desktop:run


as decribed in https://github.com/geogebra...


gradlew run will call javacc plugin and create .java files for .jj file in common/build/generated/javacc


them i imported the project into Eclipse again. actually, i deleted the old eclipse workspace and created a new one. i am not sure whether this is need or not.


but anyway, in eclipse package explore, i can right click desktop->src/main/java->geogebra->GeoGebra3D.java and select debug as->java application

© 2020 International GeoGebra Institute