Java Tools

44 views
Skip to first unread message

Aarne Ranta

unread,
Feb 11, 2011, 3:42:58 AM2/11/11
to proglang-c...@googlegroups.com
Dear All,

If you still have problems with Cup and JLex: now there is a ready-made package of these Java Tools available in


You can use it on Unix machines (Linux and Mac OS X) as follows:

- download the file to your home directory

- uncompress it under your home directory

    cd ~
    tar xvfz javatools.tgz

- export class path:

   export CLASSPATH=.:~/javatools:~/javatools/Cup

Now your BNFC-generated Java makefile will work!

  Aarne.

Arnar Birgisson

unread,
Feb 21, 2011, 11:41:08 AM2/21/11
to proglang-c...@googlegroups.com, Valentin KIM
Hi Valentin,

Seems to be a problem with your classpath. What does

echo $CLASSPATH

give you?

cheers,
Arnar

On Mon, Feb 21, 2011 at 17:34, Valentin KIM <kim....@gmail.com> wrote:
> Dear Aarne,
>
> I tried your method and I got this mesage :
>
> "java  JLex.Main CPP/Yylex
> Exception in thread "main" java.lang.NoClassDefFoundError: JLex/Main
> Caused by: java.lang.ClassNotFoundException: JLex.Main
>        at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
>        at java.security.AccessController.doPrivileged(Native Method)
>        at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
>        at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
>        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
>        at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
> Could not find the main class: JLex.Main. Program will exit.
> make: *** [bnfc] Error 1"
>
> I know the binary lab file should not work. But I tried it on the
> testgood.cc we can find on the lab pm web page. Here is the error
> message :
>
> "Exception in thread "main" java.lang.NoClassDefFoundError: lab2
> Caused by: java.lang.ClassNotFoundException: lab2
>        at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
>        at java.security.AccessController.doPrivileged(Native Method)
>        at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
>        at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
>        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
>        at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
> Could not find the main class: lab2. Program will exit."
>
> Can you tell us why ?
>
> Regards,
>
> /Val

Valentin KIM

unread,
Feb 21, 2011, 11:34:52 AM2/21/11
to proglang-course-2011

k1nggg

unread,
Nov 21, 2012, 6:51:59 AM11/21/12
to proglang-c...@googlegroups.com, aa...@chalmers.se
Thank you so much, it did work on OSX 10.8.2 (Mountain Lion).
Reply all
Reply to author
Forward
0 new messages