0

I am trying to install ta-lib for use with a ruby gem (ta-indicator), but the jar file says there is no manifest attribute. This is a fresh Win 10 install with the most recent version of Java SE and the JDK. Can someone tell me what I am doing wrong?

Note: Most of the solutions I have seen for this issue on SO involve jars the user has created. In my case the JAR has been created by someone else here, and apparently works quite well for most people.

Note 2: java -cp foo.jar full.package.name.ClassName might work if I knew that information

C:\Users\king\Downloads>java -jar ta-lib-0.4.0.jar
no main manifest attribute, in ta-lib-0.4.0.jar  

C:\Users\king\Downloads>java -version
java version "1.8.0_91"
Java(TM) SE Runtime Environment (build 1.8.0_91-b15)
Java HotSpot(TM) 64-Bit Server VM (build 25.91-b15, mixed mode)
Rilcon42
  • 9,584
  • 18
  • 83
  • 167

1 Answers1

0

The manifest in this jar does not have an application entry point i.e there is no Main-Class attribute and hence the error. This is a prerequisite for creating an executable jar file. You could verify this fact by opening the ta-lib jar and reading manifest.mf. Given ta-lib is a library than a launchable program(GUI or interactive console), this is entirely normal to not have this attribute.

As long as you have the ta-lib-0.4.0.jar in your classpath, you could call ta-lib functions like this.

To compile the program

javac -cp 'searchpath of directories/jar files separated by OS specific path separator' <sourcefiles>

To run the program

java -cp 'searchpath of directories/jar files separated by OS specific path separator' your-main-class
  • That is an excellent solution, however I am not compiling a program in java. I am attempting to install a Ruby gem – Rilcon42 Jun 19 '16 at 18:24
  • @Rilcon42 Could you tell me more about your ruby environment? Are you using JRuby or Ruby? Also, the sequence of steps you did for installing ta-indicator, ta-lib (is there a talib-ruby involved?) could be helpful. – Siva Umapathy Jun 23 '16 at 05:03