-1

I have already successfully installed jflex, however when I try to execute a file named "commentaire.flex", I use the command

    jflex commentaire.flex

as what is told in http://jflex.de/manual.html#installing-jflex, but the terminal give back

    -bash: jflex: command not found

So how can I run the .flex file with jflex generater

Yvonne
  • 21
  • 6
  • where did jflex get installed? Is it in a directory that is in your $PATH? – glenn jackman May 06 '16 at 23:23
  • in the same directory with my .flex file – Yvonne May 06 '16 at 23:49
  • do I need to change my $PATH? – Yvonne May 06 '16 at 23:49
  • Better is to leave your path as is, and put jflex in a directory in your path. (~/bin is usually in your path, for example.) – rici May 07 '16 at 01:57
  • @rici Sorry I didn't quite get you. What do you mean by 'putting jflex in a directory in your path'? – Yvonne May 07 '16 at 12:37
  • `jflex` is a file. Since it is an executable utility, it should be in some directory used to hold executable utilities. These firectories are listed in your `PATH`. So I am suggesting that you move it to such a directory. – rici May 07 '16 at 14:04
  • I've changed my CLASSPATH to the directory of lib/jflex-1.6.1.jar, but it still cannot work. The terminal keeps saying jflex: command not found – Yvonne May 07 '16 at 14:24
  • That errot is about PATH, not CLASSPATH. – rici May 07 '16 at 16:53

1 Answers1

1

jflex compiles in bash with the command

  java jflex.Main <filename>

but you have to change your CLASSPATH first

Yvonne
  • 21
  • 6