0

I am using Nashorn's JJS with -classpath to load all the jars in a folder.

I have tried the following :

jjs -J-Xmx512m -J-XX:MaxDirectMemorySize=512m -cp "C:/orientDB/lib/*" test.js

"Illegal char <> at index 16: C:/orientDB/lib/" is not a recognized option. Use "-h" or "-help" to see a list of all supported options.

jjs -J-Xmx512m -J-XX:MaxDirectMemorySize=512m -cp C:/orientDB/lib/* test.js

C:\orientDB\lib\ant-1.8.3.jar:2:7 Missing space after numeric literal ?3Z@ META-INF/?? PK

Any ideas?

adamM
  • 1,116
  • 10
  • 29

1 Answers1

0

I verified that "*" in -cp option works with jjs - I used Mac to test it. My jjs version is 1.8.0_112.

jjs -cp tmp/*

worked for me. in "tmp" directory, I had a single jar and from jjs prompt I can refer to the classes in that jar.

A. Sundararajan
  • 4,277
  • 1
  • 15
  • 30
  • I only have access to windows for a few days, I will check it on linux soon. But did not work on my windows for more than one jar in the dir. – adamM Sep 14 '17 at 20:14
  • You're right. Even on Mac, it does not seem to work if there are more than one jar files in that directory! A co-worker confirms that "*" in class path + single jar works on Windows/Cygwin - but not with "cmd" shell. If this is a very important feature, please do file an rfe against jjs / OpenJDK. Thanks. – A. Sundararajan Sep 18 '17 at 04:51
  • yes, I think this is an important feature, currently we need to ask clients to use our own script runner app instead of JJS. It works, but has a hackish feel with the standard JJS not picking up the classpath as expected. I will open an issue – adamM Sep 19 '17 at 01:29