0

I'm trying to execute a java build using commandline in OSX 10.10,

The command I'm using:

java -classpath ./bin;./libs/log4j-1.2.17.jar example.hello.Server localhost:80

I've got MAMP up and running on the classPath and java is in the same "classes" directory. Terminal is showing all options that can be used with java and is not executing the file. The same happends when using -cp.

Thanks

3
  • what error are you getting? Commented Oct 7, 2014 at 7:57
  • I'm getting the default help document; gist.github.com/anonymous/b7d07081731de79db07a Commented Oct 7, 2014 at 7:58
  • I don't think MAMP likely has anything to do with this, unless you need it just to provide the database for your application. Commented Oct 7, 2014 at 8:02

1 Answer 1

4

You have a misplaced ; instead of : in your classpath string. Try:

java -classpath ./bin:./libs/log4j-1.2.17.jar example.hello.Server localhost:80

Remember on OSX (or any other Unix flavor system) path separator is : not ; as on Windows/DOS

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks it worked. Code was used by a teacher's DOS example. So didn't see the ;.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.