EgonOlsen71 / basicv2

A Commodore (CBM) BASIC V2 interpreter/compiler written in Java
https://egonolsen71.github.io/basicv2/
The Unlicense
86 stars 15 forks source link

How to use from any directory and avoid "Error: Could not find or load main class com.sixtyfour.cbmnative.shell.MoSpeedCL" #33

Closed Fabrizio-Caruso closed 5 years ago

Fabrizio-Caruso commented 5 years ago

If I run it outside the dist directory I get: "Error: Could not find or load main class com.sixtyfour.cbmnative.shell.MoSpeedCL"

Is there a suggested clean way to install the compiler in a way that it can be called from anywhere?

nippur72 commented 5 years ago

same issue here.

I suspect a regression because an older version of the .jar is working fine as usual.

EgonOlsen71 commented 5 years ago

That's strange. I haven't changed anything on purpose, not the cmd and not the jar in that respect. I would try for myself, but I'm on holiday at the moment, so I can't.

EgonOlsen71 commented 5 years ago

I don't see how this could have ever worked this way. The java call searches for the jar in the current directory and in a subdir called "dist" of the current directory. Neither can be found if you call it from somewhere else by adding the cmd's directory to the PATH. I've updated the cmd-file now, so that it searches in the PATHed-to directory as well. It worked for me, please give it a try.

nippur72 commented 5 years ago

I've just tried it on my W10 machine and it works perfectly, thanks!

Lindwedler commented 4 years ago

Hello, i have the same problem. I get alway an error message that the class MoSpeed could not be found. What can i do?

error

EgonOlsen71 commented 4 years ago

Looks like a problem with the space in the directory name. That seems to confuse Java somehow. Try to rename the directory to something without a space in it and try again.

Lindwedler commented 4 years ago

Yes, thats it! Now it works. Thank you very much!!!

EgonOlsen71 commented 4 years ago

I'll look into why this happens. Might be something that I can fix in the script somehow.