Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

annotations not working? #3804

Open
mooreniemi opened this issue Apr 14, 2016 · 1 comment
Open

annotations not working? #3804

mooreniemi opened this issue Apr 14, 2016 · 1 comment

Comments

@mooreniemi
Copy link

Environment

jruby 1.7.19 (1.9.3p551) 2015-01-29 20786bd on Java HotSpot(TM) 64-Bit Server VM 1.8.0_65-b17 +jit [darwin-x86_64]

--1.9 -J-Xms256m -J-Xmx1024m -J-Dsun.rmi.dgc.client.gcInterval=3600000 -J-Dsun.rmi.dgc.server.gcInterval=3600000 -J-XX:+UseConcMarkSweepGC -J-XX:+CMSClassUnloadingEnabled -J-XX:MaxPermSize=128m --headless

Darwin C02LX2KVFD58.local 15.4.0 Darwin Kernel Version 15.4.0: Fri Feb 26 22:08:05 PST 2016; root:xnu-3248.40.184~3/RELEASE_X86_64 x86_64

Test I used

require 'java'
require 'jruby/core_ext'

# from https://github.com/jruby/jruby/wiki/JRuby-Reference#java_annotation
java_package 'test.hello'
java_annotation 'Path("/helloworld")'
class HelloWorld
end

java_class = HelloWorld.become_java!
puts "java_class had annotations: #{!java_class.annotations.empty?}"

I expect it to print I had annotations: true, but it prints I had annotations: false. Correspondingly, when I try to use an annotated Ruby class in some Java code, Java also complains that none exist.

@HeikoBornholdt
Copy link

HeikoBornholdt commented Mar 20, 2017

Same problem here.

It seems to work, when you compile the .rb files to .class files first.

jruby 9.1.6.0 (2.3.1) 2016-11-09 0150a76 Java HotSpot(TM) 64-Bit Server VM 25.121-b13 on 1.8.0_121-b13 +jit [darwin-x86_64]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants