Beginner question: cannot run `bin/gremlin.sh`

1,303 views
Skip to first unread message

The Bang Nguyen

unread,
Apr 22, 2016, 1:46:46 PM4/22/16
to Gremlin-users
Hi all,

I am studying TinkerPop Gremlin following this tutorial http://tinkerpop.apache.org/docs/3.2.0-incubating/tutorials/getting-started/.

However, when running `bin/gremlin.sh` I got following error:
```
Error: Could not find or load main class 1:-Dtinkerpop.ext=.Users.username.study.tinkerpop.console.bin....ext
```

Could you please help?

Thank you very much in advance
Bang

Daniel Kuppitz

unread,
Apr 22, 2016, 1:57:47 PM4/22/16
to gremli...@googlegroups.com
What's the default value of JAVA_OPTIONS on your system? Looks like it contains an invalid value. That's at least how I can reproduce the error:

$ JAVA_OPTIONS="invalid" bin/gremlin.sh
Error: Could not find or load main class invalid

Cheers,
Daniel


--
You received this message because you are subscribed to the Google Groups "Gremlin-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/80a661b7-4a1d-46b3-9c83-3d3ea2bfa8b6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

The Bang Nguyen

unread,
Apr 23, 2016, 3:24:37 AM4/23/16
to Gremlin-users
Hi Daniel, 

Thank you very much for your help

My JAVA_OPTIONS env is not set. It's probably the reason why I got the error.

How can I set that?

Thank you
Bang

Daniel Kuppitz

unread,
Apr 23, 2016, 3:49:04 AM4/23/16
to gremli...@googlegroups.com
Unset JAVA_OPTIONS shouldn't be a problem at all. Now I wonder where it injects the "1:" in your case.
What's your OS? We've tested on Ubuntu and OSX and never ran into this problem.

Cheers,
Daniel


The Bang Nguyen

unread,
Apr 23, 2016, 3:50:41 AM4/23/16
to gremli...@googlegroups.com
Hi Daniel,

I use OSX El Capitan.

Thanks,
Bang

The Bang Nguyen

unread,
Apr 23, 2016, 5:51:10 AM4/23/16
to Gremlin-users
Hi Daniel,

FYI, I can run `bin/gremlin.sh` file of `titanDB`.
Probably, there's a discrepancy between the two.
However, I have not worked it out yet.

Cheers,
Bang 
To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-users+unsubscribe@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Gremlin-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-users+unsubscribe@googlegroups.com.

Jason Plurad

unread,
Apr 23, 2016, 11:47:17 AM4/23/16
to Gremlin-users
What's the version of awk on your Mac (using `awk -version`)?

There's probably something unanticipated set in your env. If you could post it (using `env | sort`) that could be helpful.

You could also try using an older version of the TP3 gremlin.sh for comparison.

-- Jason

--
You received this message because you are subscribed to the Google Groups "Gremlin-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-user...@googlegroups.com.

The Bang Nguyen

unread,
Apr 24, 2016, 3:45:05 AM4/24/16
to gremli...@googlegroups.com
HI Jason,

Thank you for your email.

`awk -version` -> awk version 20070501

`env | sort` ->
```
Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.eVtAg5B6G7/Render
BINSTUBS_PATH=./bin:./.bundle/bin:./.bundle/binstubs
EDITOR=mvim
EVENT_NOKQUEUE=1
GEM_HOME=/Users/bangn/.gem/ruby/2.3.0
GEM_PATH=/Users/bangn/.gem/ruby/2.3.0:/Users/bangn/.rubies/ruby-2.3.0/lib/ruby/gems/2.3.0
GEM_ROOT=/Users/bangn/.rubies/ruby-2.3.0/lib/ruby/gems/2.3.0
GREP_OPTIONS= -ni --color=auto --exclude-dir=.git --exclude-dir=node_modules --exclude-dir=dist
HOME=/Users/bangn
ITERM_PROFILE=Default
ITERM_SESSION_ID=w0t0p1:6002F81A-119E-4CD8-A202-ADC2A508B817
LANG=en_AU.UTF-8
LOGNAME=bangn
LSCOLORS=Gxfxcxdxbxegedabagacad
OLDPWD=/Users/bangn/study/titanDB/titan-1.0.0-hadoop1
PATH=/Users/bangn/.gem/ruby/2.3.0/bin:/Users/bangn/.rubies/ruby-2.3.0/lib/ruby/gems/2.3.0/bin:/Users/bangn/.rubies/ruby-2.3.0/bin:/usr/local/heroku/bin:./bin:./.bundle/bin:./.bundle/binstubs:/Users/bangn/.cabal/bin:/usr/local/heroku/bin:/usr/local/share/npm/bin:/usr/local/bin:/usr/local/sbin:/Users/bangn/tools/arcanist/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/heroku/bin:./bin:./.bundle/bin:./.bundle/binstubs:/Users/bangn/.cabal/bin:/usr/local/share/npm/bin:/usr/local/sbin:/Users/bangn/tools/arcanist/bin:/Users/bangn/.rvm/bin:/Users/bangn/.rvm/bin
PWD=/Users/bangn/study/titanDB/titan-1.0.0-hadoop1
RUBYOPT=
RUBY_ENGINE=ruby
RUBY_ROOT=/Users/bangn/.rubies/ruby-2.3.0
RUBY_VERSION=2.3.0
SHELL=/bin/zsh
SHLVL=3
SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.aqRnyqXdt9/Listeners
TERM=screen-256color
TERM_PROGRAM=iTerm.app
TMPDIR=/var/folders/3s/jj4k07cx4p90ygv7rdzfdnbh0000gn/T/
TMUX=/private/var/folders/3s/jj4k07cx4p90ygv7rdzfdnbh0000gn/T/tmux-501/default,76020,0
TMUX_PANE=%89
USER=bangn
VISUAL=mvim
XPC_FLAGS=0x0
XPC_SERVICE_NAME=0
_=/usr/bin/env
__CF_USER_TEXT_ENCODING=0x1F5:0x0:0x0
```

Thank you,
Bang

Jason Plurad

unread,
Apr 24, 2016, 2:19:08 PM4/24/16
to Gremlin-users
The Bang,

Thanks for posting those details. I didn't see anything unusual there, but I didn't see a JAVA_HOME in there, so what version are you using (`java -version`)?

Did you rename the directory after you unzipped apache-gremlin-console-3.2.0-incubating-bin.zip?


```
Error: Could not find or load main class 1:-Dtinkerpop.ext=.Users.username.study.tinkerpop.console.bin....ext
```

The odd things about this are:
1. it thinks the main class is "1" instead of org.apache.tinkerpop.gremlin.console.Console
2. the tinkerpop.ext value has directory path delimiter of '.' instead of '/'
3. the name of the gremlin-console directory what is in the zip file

I did a quick run through on my Mac for to reconfirm for myself that it works https://gist.github.com/pluradj/83426b3a3a3af35cdaeb291449e3612f

Maybe try adjusting your PATH in your terminal session to remove any unneeded items. Perhaps there's some sort of executable conflict that override the bash commands in gremlin.sh.

-- Jason

The Bang Nguyen

unread,
Apr 25, 2016, 12:17:15 AM4/25/16
to gremli...@googlegroups.com
Hi Jason,

Thank you for your email.
>so what version are you using (`java -version`)?
```
java version "1.8.0_77"
Java(TM) SE Runtime Environment (build 1.8.0_77-b03)
Java HotSpot(TM) 64-Bit Server VM (build 25.77-b03, mixed mode)
```

> Did you rename the directory after you unzipped apache-gremlin-console-3.2.0-incubating-bin.zip?
Yes, I did. However, even I used the directory after unzipping apache-gremlin-console-3.2.0-incubating-bin.zip, it still does not work.

Thank you,
Bang

The Bang Nguyen

unread,
Apr 25, 2016, 12:39:43 AM4/25/16
to Gremlin-users
Hi Jason,

FYI, attached file is console output after I put `set -x` into `gremlin.sh` and run the script.

Thank you,
Bang

To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-users+unsubscribe@googlegroups.com.
error.txt

Daniel Kuppitz

unread,
Apr 25, 2016, 2:43:15 AM4/25/16
to gremli...@googlegroups.com
This is so weird. I have no idea where you get this numbered output from. Maybe from the paste command?

It's purpose is just to ensure that we don't overwrite any user-defined JAVA_OPTIONS and since yours are empty, it should be fine.

Cheers,
Daniel


--
You received this message because you are subscribed to the Google Groups "Gremlin-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-user...@googlegroups.com.

The Bang Nguyen

unread,
Apr 25, 2016, 5:58:34 AM4/25/16
to gremli...@googlegroups.com
Hi Daniel,

> Maybe from the paste command?
What do you mean by `paste` command? I believe I did not use it.
It works. Thank you very much

Thank you,
Bang


The Bang Nguyen

unread,
Apr 25, 2016, 6:10:55 AM4/25/16
to Gremlin-users
Hi Daniel,

> Maybe from the paste command?
I played around by commenting out `grep` and `paste` at #L103.
It turned out that `grep` command adds the number in front of the option.

Cheers,
Bang

On Monday, April 25, 2016 at 7:58:34 PM UTC+10, The Bang Nguyen wrote:
Hi Daniel,

To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-users+unsubscribe@googlegroups.com.

-- 
You received this message because you are subscribed to the Google Groups "Gremlin-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-users+unsubscribe@googlegroups.com.

-- 
You received this message because you are subscribed to the Google Groups "Gremlin-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-users+unsubscribe@googlegroups.com.

Jason Plurad

unread,
Apr 25, 2016, 9:15:45 AM4/25/16
to Gremlin-users
The Bang,

Interesting! Changing line 103 to use `grep -vn` reproduces the original issue.

Do you have an alias set in one of your dot files (i.e. alias grep='grep -n')?

-- Jason


On Monday, April 25, 2016 at 6:10:55 AM UTC-4, The Bang Nguyen wrote:
Hi Daniel,


-- 
You received this message because you are subscribed to the Google Groups "Gremlin-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-user...@googlegroups.com.

-- 
You received this message because you are subscribed to the Google Groups "Gremlin-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-user...@googlegroups.com.

The Bang Nguyen

unread,
Apr 25, 2016, 7:45:51 PM4/25/16
to gremli...@googlegroups.com
Hi Jason,

Ah yes, you are right. It’s my bad.
All sorted.

Thank you and Daniel for your time.

Cheers,
Bang

muj...@kofera.com

unread,
Mar 23, 2018, 12:09:44 AM3/23/18
to Gremlin-users
Hi, I had the same problem in mac os, and I solve the probelm by
1. put the unzip folder to Application folder in mac
2. go to that folder (unzip folder in Application folder)
3. run the  bin/gremlin.sh
it work, goodluck
Reply all
Reply to author
Forward
0 new messages