Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Package org.perlito.Perlito5 does not exist with jrunscript #50

Closed
dionys opened this issue Dec 5, 2017 · 5 comments
Closed

Package org.perlito.Perlito5 does not exist with jrunscript #50

dionys opened this issue Dec 5, 2017 · 5 comments
Assignees

Comments

@dionys
Copy link
Contributor

dionys commented Dec 5, 2017

When I try to run on last master:

jrunscript -cp .:perlito.jar -l Perl5 -e 'print 1'

I receive the following error message:

/PlEval0.java:1: error: package org.perlito.Perlito5 does not exist
import org.perlito.Perlito5.*;
^
/PlEval0.java:6: error: cannot find symbol
    public static PlObject runEval(int want, Object scalar_val, Object array_val, Object hash_val, PlArray List__) {
                                                                                                   ^
  symbol:   class PlArray
  location: class PlEval0
/PlEval0.java:6: error: cannot find symbol
    public static PlObject runEval(int want, Object scalar_val, Object array_val, Object hash_val, PlArray List__) {
                  ^
  symbol:   class PlObject
  location: class PlEval0
/PlEval0.java:9: error: cannot find symbol
            PlObject ret = new PlClosure(PlCx.UNDEF, new PlObject[]{  }, "main", true) {
            ^
  symbol:   class PlObject
  location: class PlEval0
/PlEval0.java:20: error: cannot find symbol
            }.apply(want, new PlArray());
                              ^
  symbol:   class PlArray
  location: class PlEval0
/PlEval0.java:9: error: cannot find symbol
            PlObject ret = new PlClosure(PlCx.UNDEF, new PlObject[]{  }, "main", true) {
                               ^
  symbol:   class PlClosure
  location: class PlEval0
/PlEval0.java:9: error: cannot find symbol
            PlObject ret = new PlClosure(PlCx.UNDEF, new PlObject[]{  }, "main", true) {
                                         ^
  symbol:   variable PlCx
  location: class PlEval0
/PlEval0.java:9: error: cannot find symbol
            PlObject ret = new PlClosure(PlCx.UNDEF, new PlObject[]{  }, "main", true) {
                                                         ^
  symbol:   class PlObject
  location: class PlEval0
/PlEval0.java:21: error: cannot find symbol
            PlV.sset("main::@", PlCx.EMPTY);
                                ^
  symbol:   variable PlCx
  location: class PlEval0
/PlEval0.java:21: error: cannot find symbol
            PlV.sset("main::@", PlCx.EMPTY);
            ^
  symbol:   variable PlV
  location: class PlEval0
/PlEval0.java:24: error: cannot find symbol
        catch(PlReturnException e) {
              ^
  symbol:   class PlReturnException
  location: class PlEval0
/PlEval0.java:25: error: cannot find symbol
            PlV.sset("main::@", PlCx.EMPTY);
                                ^
  symbol:   variable PlCx
  location: class PlEval0
/PlEval0.java:25: error: cannot find symbol
            PlV.sset("main::@", PlCx.EMPTY);
            ^
  symbol:   variable PlV
  location: class PlEval0
/PlEval0.java:28: error: cannot find symbol
        catch(PlNextException e) {
              ^
  symbol:   class PlNextException
  location: class PlEval0
/PlEval0.java:29: error: cannot find symbol
            PlV.sset("main::@", PlCx.EMPTY);
                                ^
  symbol:   variable PlCx
  location: class PlEval0
/PlEval0.java:29: error: cannot find symbol
            PlV.sset("main::@", PlCx.EMPTY);
            ^
  symbol:   variable PlV
  location: class PlEval0
/PlEval0.java:32: error: cannot find symbol
        catch(PlLastException e) {
              ^
  symbol:   class PlLastException
  location: class PlEval0
/PlEval0.java:33: error: cannot find symbol
            PlV.sset("main::@", PlCx.EMPTY);
                                ^
  symbol:   variable PlCx
  location: class PlEval0
/PlEval0.java:33: error: cannot find symbol
            PlV.sset("main::@", PlCx.EMPTY);
            ^
  symbol:   variable PlV
  location: class PlEval0
/PlEval0.java:36: error: cannot find symbol
        catch(PlRedoException e) {
              ^
  symbol:   class PlRedoException
  location: class PlEval0
/PlEval0.java:37: error: cannot find symbol
            PlV.sset("main::@", PlCx.EMPTY);
                                ^
  symbol:   variable PlCx
  location: class PlEval0
/PlEval0.java:37: error: cannot find symbol
            PlV.sset("main::@", PlCx.EMPTY);
            ^
  symbol:   variable PlV
  location: class PlEval0
/PlEval0.java:42: error: cannot find symbol
            PlV.sset("main::@", new PlString("" + message));
                                    ^
  symbol:   class PlString
  location: class PlEval0
/PlEval0.java:42: error: cannot find symbol
            PlV.sset("main::@", new PlString("" + message));
            ^
  symbol:   variable PlV
  location: class PlEval0
/PlEval0.java:43: error: cannot find symbol
            return PerlOp.context(want);
                   ^
  symbol:   variable PerlOp
  location: class PlEval0
25 errors
script error: Unknown error during compilation.

Running make test-5jar is ok. Runing java -jar perlito5.jar -I src5/lib -e 'print 1' is ok. Only jrunscript throws the error.

@fglock
Copy link
Owner

fglock commented Dec 6, 2017

Note that

jrunscript -cp .:perlito.jar -l Perl5 -e 'print 1'

should be:

jrunscript -cp .:perlito5.jar -l Perl5 -e 'print 1'

but that doesn't explain the problem, because even this works here:

jrunscript -cp . -l Perl5 -e 'print 1'

The error may be related to the problem fixed in commit 066f25c from about 2 weeks ago:

classLoader = new DynamicClassLoader( new PlArray().getClass().getClassLoader() );

This patch makes sure that eval runs in the same ClassLoader context as the Perl runtime (PlArray comes from the Perl runtime).

I can't reproduce the bug here.

Would you try the sequence below, hopefully it will give us some hints on how to reproduce the problem:

git reset --hard
git pull
make clean
make
jrunscript -cp .:perlito5.jar -l Perl5 -e 'print "1\n" '
java -version
git show --oneline -s

@dionys
Copy link
Contributor Author

dionys commented Dec 6, 2017

Yes, it's typo. I ran:

jrunscript -cp .:perlito5.jar -l Perl5 -e 'print 1'

The error is not solved after all your commands are executed.

> java -version
openjdk version "1.8.0_151"
OpenJDK Runtime Environment (build 1.8.0_151-8u151-b12-0ubuntu0.16.04.2-b12)
OpenJDK 64-Bit Server VM (build 25.151-b12, mixed mode)

> git show --oneline -s
5822b31 Perlito5 - java - Java API wip

@fglock
Copy link
Owner

fglock commented Dec 6, 2017

I can reproduce with Java 8:

$ java -version
java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)

The error goes away with Java 9:

$ java -version
java version "9.0.1"
Java(TM) SE Runtime Environment (build 9.0.1+11)
Java HotSpot(TM) 64-Bit Server VM (build 9.0.1+11, mixed mode)

fglock added a commit that referenced this issue Dec 6, 2017
@fglock
Copy link
Owner

fglock commented Dec 6, 2017

73ade0c seems to fix it, tested in Oracle Java "1.8.0_131" and "9.0.1"

@dionys
Copy link
Contributor Author

dionys commented Dec 6, 2017

It works. Thanks!

@fglock fglock closed this as completed Dec 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants