0

in another thread about JavaParser you wrote: "it should not have any dependency". But JavaParser has a dependency to a special ParseException:

In JavaParser, line 205: throw new ParseException(ioe.getMessage())

The constructor ParseException(String) is undefined - Add argument to match ParseException(String, int) E.g. java.text.ParseException (and three others) has one more int parameter, errorOffset.

In line 125 (and 8 more lines): new InstanceJavaParser(reader1).parse...()

The method parse() from the type InstanceJavaParser refers to the missing type ParseException

Which jar can I download from where to get this special ParseException?

(edited)

Maybe I should provide more details than fit into a comment:

In Windows 10: Maven installed, mkdir D:\workspaces\trunk\JavaParser-from-Maven\

cmd
D:
cd D:\workspaces\trunk\JavaParser-from-Maven\
D:\workspaces\trunk\JavaParser-from-Maven>mvn archetype:generate -DgroupId=com.github.javaparser -DartifactId=javaparser-core -DinteractiveMode=false    => 
Downloaded: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-container-default/1.0-alpha-9-stable-1/plexus-container-default-1.0-alpha-9-stable-1.pom (4 KB at 35.4 KB/sec)
[...] and many more .pom files [...]
[INFO] Generating project in Batch mode
[INFO] No archetype defined. Using maven-archetype-quickstart (org.apache.maven.archetypes:maven-archetype-quickstart:1.0)
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/archetypes/maven-archetype-quickstart/1.0/maven-archetype-quickstart-1.0.jar
Downloaded: https://repo.maven.apache.org/maven2/org/apache/maven/archetypes/maven-archetype-quickstart/1.0/maven-archetype-quickstart-1.0.jar (5 KB at 38.5 KB/sec)
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/archetypes/maven-archetype-quickstart/1.0/maven-archetype-quickstart-1.0.pom
Downloaded: https://repo.maven.apache.org/maven2/org/apache/maven/archetypes/maven-archetype-quickstart/1.0/maven-archetype-quickstart-1.0.pom (703 B at 5.5 KB/sec)
[INFO] ----------------------------------------------------------------------------
[INFO] Using following parameters for creating project from Old (1.x) Archetype: maven-archetype-quickstart:1.0
[INFO] ----------------------------------------------------------------------------
[INFO] Parameter: basedir, Value: D:\workspaces\trunk\JavaParser-from-Maven
[INFO] Parameter: package, Value: com.github.javaparser
[INFO] Parameter: groupId, Value: com.github.javaparser
[INFO] Parameter: artifactId, Value: javaparser-core
[INFO] Parameter: packageName, Value: com.github.javaparser
[INFO] Parameter: version, Value: 1.0-SNAPSHOT
[INFO] project created from Old (1.x) Archetype in dir: D:\workspaces\trunk\JavaParser-from-Maven\javaparser-core
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS

[...] => D:\workspaces\trunk\JavaParser-from-Maven\javaparser-core\pom.xml created

D:\workspaces\trunk\JavaParser-from-Maven\javaparser-core\src\main\java\com\github\javaparser\App.java (1 KB) created, saying "Hello World"

=> a lot of .pom files and a App.java have been downloades, but no JavaParser files yet => acc. to "how To Compile Sources":

Trying with a version argument:

D:\workspaces\trunk\JavaParser-from-Maven>mvn archetype:generate -DgroupId=com.github.javaparser -DartifactId=javaparser-core -Dversion=2.1.0 -DinteractiveMode=false    =>
[...]  Building Maven Stub Project (No POM) 1  
[...] [INFO] >>> maven-archetype-plugin:2.4:generate (default-cli) > generate-sources @ standalone-pom >>>

=> a lot of .pom files and one App.java have been downloades, but no JavaParser files yet

=> acc. to "how To Compile Sources":

cd javaparser-core     // where the POM.xml resides
mvn clean install    =>
Downloaded: https://repo.maven.apache.org/maven2/org/apache/maven/maven-core/2.0.6/maven-core-2.0.6.jar (149 KB at 152.8 KB/sec)
[...] [INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ javaparser-core ---
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/maven-plugin-api/2.0.9/maven-plugin-api-2.0.9.pom [...]
[...] [INFO] Changes detected - recompiling the module!
[...]  T E S T S
Running com.github.javaparser.AppTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.015 sec

To generate the additional source files:

D:\workspaces\trunk\JavaParser-from-Maven\javaparser-core>mvn javacc:javacc    => 
[INFO] Scanning for projects...
Downloading: https://repo.maven.apache.org/maven2/org/codehaus/mojo/javacc-maven-plugin/maven-metadata.xml [...]
[...] [INFO] Building javaparser-core 2.1.0 [...]
Downloaded: ... .pom files ...
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/maven-plugin-api/2.0.4/maven-plugin-api-2.0.4.jar
Downloaded: ... another 57 .jar files ...
[INFO] Skipping non-existing source directory: D:\workspaces\trunk\JavaParser-from-Maven\javaparser-core\src\main\javacc
[INFO] BUILD SUCCESS

Why do I just get a dummy App.java and nothing concerning JavaParser?

Where do all the .pom and .jar go?

What do all the .pom and .jar affect?

Fifi
  • 13
  • 6

2 Answers2

1

The file is generated when you build the JavaParser project. That's why it is not in the repository, and that's why we can still have zero dependencies.

If the problem is that your IDE cannot find this file, make it point to the directory inside the target folder containing the generated sources.

Danny
  • 161
  • 1
  • 6
0

It appears to be a custom ParseException. Its fully qualified path is com.github.javaparser.ParseException. However, it appears to be missing from the repo:

https://github.com/javaparser/javaparser/tree/75ace5ff3409465db4b2a8b9bd0e98366c94686f/javaparser-core/src/main/java/com/github/javaparser

You also wish to look at the guidance on how to build from source:

https://github.com/javaparser/javaparser#how-to-compile-sources

ManoDestra
  • 6,325
  • 6
  • 26
  • 50
  • I installed Maven and followed this "...how-to-compile-sources" but got only a D:\workspaces\trunk\JavaParser-from-Maven\javaparser-core\src\main\java\com\github\javaparser\App.java and a ...\github\javaparser\App.class. – Fifi Jul 16 '16 at 19:00
  • I had intended to get the compilable *.java instead of the broken ones that I had got via Git. – Fifi Jul 16 '16 at 19:02
  • App.java just says "Hello World" - what is going wrong? What have all the downloades POM files affected? – Fifi Jul 16 '16 at 19:05
  • Without seeing App.java, I am unable to say. You'll need to update your question with that source code, or ask another question, if it's sufficiently different from the existing question. – ManoDestra Jul 18 '16 at 13:20