From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 56345 invoked by alias); 2 Dec 2018 23:01:00 -0000 Mailing-List: contact kawa-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: kawa-owner@sourceware.org Received: (qmail 56196 invoked by uid 89); 2 Dec 2018 23:00:50 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=0.5 required=5.0 tests=BAYES_20,FREEMAIL_FROM,HTML_MESSAGE,KAM_NUMSUBJECT,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=no version=3.3.2 spammy=HTo:U*kawa, H*Ad:U*kawa, UD:http, explore X-HELO: mail-it1-f169.google.com Received: from mail-it1-f169.google.com (HELO mail-it1-f169.google.com) (209.85.166.169) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 02 Dec 2018 23:00:47 +0000 Received: by mail-it1-f169.google.com with SMTP id o19so6451485itg.5 for ; Sun, 02 Dec 2018 15:00:46 -0800 (PST) MIME-Version: 1.0 From: daniel szmulewicz Date: Sun, 02 Dec 2018 23:01:00 -0000 Message-ID: Subject: java 11 To: kawa@sourceware.org Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2018-q4/txt/msg00031.txt.bz2 Hi, I wrote my first Kawa script, yay! I wanted to explore Java interop, so the following script does a http request with the new HttpClient that ships in Java 11. However, as you can see, some methods needed to be fully qualified in order to make it work. Is this a case of reflection not working with the new Java modules? Am I missing something? Thank you! -- Code below this line (import (class java.net URI)) (import (class java.net.http HttpClient HttpRequest HttpResponse)) (define uri (URI:create " http://cr.openjdk.java.net/~chegar/httpclient/02/javadoc/api/java.net.http/java/net/http/HttpClient.html ")) (define body-handler (HttpResponse:BodyHandlers:ofString)) (define client (*:build (HttpClient:newBuilder))) (define request (*:build (*:uri (HttpRequest:newBuilder) uri))) (define response (java.net.http.HttpClient:send client request body-handler)) (display (java.net.http.HttpResponse:body response))