0

i'm currently working on a Lexer in Java, i'm using jflex to do this, when my partner runs the code it works, he pushed it into a repo in github. I cloned it and when trying to run it, it says it cannot find a symbol which is Lexer, this is a class that jflex creates. I

I was expecting to be able to use the jflex library, which is stored in the lib directory in the project, also, in the .vscode directory we created a settings.json in order to be able to use it, we thought it worked but apparently when someone clones the repo it doesn't work. How can i solve this?

1 Answers1

1

Download needed library

Commonly, projects uploaded to GitHub omit the various libraries needed by the app.

So you will need to manually obtain the needed library, usually a JAR file. Then place that JAR file in a location accessible by your project.

When deploying your app, you will need to either include the library within your app, or make the library available on the runtime computer.

Dependency management & build tool

Needed libraries are referred to as “dependencies”.

If doing any serious work in Java, I strongly recommend you learn how to use an IDE (such as IntelliJ, Eclipse, or NetBeans) in conjunction with a dependency management tool (such as Apache Maven or Apache Gradle).

Tools like Maven & Gradle will automatically locate a copy of your declared dependency libraries, automatically download from a repository, and then install within your project.

These tools (IDEs, and dependency managers) do come with a learning curve. But that learning time is well spent if you are invested in being a Java developer.

Basil Bourque
  • 303,325
  • 100
  • 852
  • 1,154