Get match result by name is not possible when using Java 10 - kotlin

Heading says it all:
Java version information, tested on opensuse:
java version "10.0.1" 2018-04-17
Java(TM) SE Runtime Environment 18.3 (build 10.0.1+10)
Java HotSpot(TM) 64-Bit Server VM 18.3 (build 10.0.1+10, mixed mode)
Stacktrace:
java.lang.UnsupportedOperationException: Retrieving groups by name is not supported on this platform.
at kotlin.internal.jdk8.JDK8PlatformImplementations.getMatchResultNamedGroup(JDK8PlatformImplementations.kt:28)
at kotlin.text.MatcherMatchResult$groups$1.get(Regex.kt:260)
at kotlin.text.jdk8.RegexExtensionsJDK8Kt.get(RegexExtensions.kt:33)
Question: Will this be fixed?
I am pretty sure that I can get the first regex, but that might not be possible in many other cases.
Thanks for your help (sorry for formatting, posting from mobile website)

According to the issue KT-20865, this problem is fixed in Kotlin 1.3.20

It is reproduced in Android (Java 8). Use
REGULAR_EXPRESSION.toRegex().find(sample)?.groupValues?.getOrNull(1)
instead, where needed groups start from 1 (see also https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.text/-match-result/group-values.html).

Related

Boot layer initialization error when running RinSim examples on IntelliJ Idea

I'm trying to get some RinSim examples running on IntelliJ Idea Ultimate 2018.1.4. I've tried following the instructions on http://rinsim.rinde.nl/installation/intellij/, but I run into the following error when performing step 11 in the guide:
Error occurred during initialization of boot layer
java.lang.module.FindException: Unable to derive module descriptor for /home/svka/.m2/repository/org/jppf/jppf-client/4.1.3/jppf-client-4.1.3.jar
Caused by: java.lang.module.InvalidModuleDescriptorException: Provider class org.jppf.server.scheduler.bundle.providers.RLBundlerProvider not in module
The JDK I'm using is:
openjdk 10.0.1 2018-04-17
OpenJDK Runtime Environment (build 10.0.1+10-Ubuntu-3ubuntu1)
OpenJDK 64-Bit Server VM (build 10.0.1+10-Ubuntu-3ubuntu1, mixed mode)
JRE: 1.8.0_152-release-1136-b39 amd64
Furthermore, I'm on Kubuntu 18.04.
The example runs on Eclipse, so I suppose there is something wrong with some settings in IntelliJ or something similar, but I have no clue on what to look for and can't find any similar posts by googling. Any help or pointers would be greatly appreciated.

IntelliJ IDEA seems to not fully switch to the new jdk

I am stuck with the following problem regarding Intellij IDEA.
I had installed the following java version:
java version "1.7.0_51"
Java(TM) SE Runtime Environment (build 1.7.0_51-b13)
Java HotSpot(TM) Client VM (build 24.51-b03, mixed mode, sharing)
on my Win7 PC and using Intellij IDEA v14.1.3.
After some time, I have upgraded my jdk and now I have installed the following:
java version "1.7.0_71"
Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
Java HotSpot(TM) Client VM (build 24.71-b01, mixed mode, sharing)
I have consequently changed all the references to point to the new jdk in system variables and in Intellij in Project structure ...
Everything seemed to work fine (when I run a program from Intellij I see that the command java is invoked from the right path).
The problem is that for some reasons, when I open the integrated terminal in Intellij and write java -version the result is the old version (1.7.0_51).
I realized this because of some issues of the old version of java I face when I run my unit tests that should have been resolved in the new version.
Have anybody any idea how to solve this?
Thank you in advance!
I would not only update the java version, but completely delete it from the machine. Obviously, you have not removed all the references to the old java, as your problem statements describes.
Maybe the Java Uninstall tool might be helpful for this? Then make a clean new installation.

iReport 5.5.0 won't start

I want to use iReport on ubuntu 12.04. When I try to start it, it stands still and just gives me this error:
Java HotSpot(TM) 64-Bit Server VM warning: You have loaded library /tmp/jna4023560596826437553.tmp which might have disabled stack guard. The VM will try to fix the stack guard now.
It's highly recommended that you fix the library with 'execstack -c <libfile>', or link it with '-z noexecstack'.
How can I solve this problem ?
Edit: I tried: execstack -c /tmp/jna4023560596826437553.tmp but that didn't help.
This error seems more related to a JVM problem instead of jasper. Indeed, Java 7 on linux has a feature which blocks code written in C (or other languages like Ruby etc) and linked into Java (the so-called Java Native Interface - JNI) from halting the whole VM if it’s written badly or maliciously.
So, if you're using java version 1.7, getting back to 1.6 should do the trick. But if you want to keep this version, then try a clean uninstall and re-install of java:
Uninstall,
Install
Notice that if you're not running on 1.7 , it could be a compatibility problem. Try to match the right jars required for iReport to get it work on linux.
I'm using ubuntu and I did below,
Opened the ireport.conf
and uncomment jdkhome
and added java 7 paths (since my default is java 8)
jdkhome=/home/bhanuka/Apps/jdk-7u80-linux-x64/jdk1.7.0_80

No unprofiled JVM found

I have WebSphere 7 Aplication Server. There is Java VM 1.6 installed. Linux.
Java version "1.6.0"
Java(TM) SE Runtime Environment (build pxa6460sr10fp1-20120321_01(SR10 FP1))
IBM J9 VM (build 2.4, JRE 1.6.0 IBM J9 2.4 Linux amd64-64 jvmxa6460sr10fp1-20120202_101568 (JIT enabled, AOT enabled)
J9VM - 20120202_101568
JIT - r9_20111107_21307ifx1
GC - 20120202_AA)
JCL - 20120320_01
I try to use jProfiler, using trial lisence. But don't want to change something on the server this time.
So I download jprofiler for linux to my server.
Then I run bin/jpenable and it says that:
No unprofiled JVM found
Now I don't know what to do, googling doesn't give any useful result. Can You tell me in what way I must search a problem? May be incorrect path or something else. I hope You'll understand my english (it is not so good).
Have a look at this help pdf, in specifically check out Attach to local JVM session.
Also, have a look at this answer and this question.
hope it will help..

Is the OpenJDK JVM the same as the Oracle Java SE JVM?

I understand that the Oracle Java SE contains closed source extensions and tools that are not part of the OpenJDK however is the Oracle Java SE JVM identical to the OpenJDK JVM or does Oracle make changes to the OpenJDK JVM before releasing it as a Java SE JVM?
Update 1:
I found some info from the JDK7 updates projects: http://openjdk.java.net/projects/jdk7u/qanda.html
Will the 7 Update Project receive security fixes from Oracle?
Yes.
As with OpenJDK 6, security fixes are first kept confidential and applied to a private forest before being pushed to the public forest as part of the general synchronized publication of the fix to effected JDK release trains. In addition, they will not go through the public code review and putback approval process, and their corresponding issues in the Project's issue tracker will not be publicly visible.
OpenJDK is the reference implementation of Java as of version 7.
OpenJDK 7 is the starting point for the version that Oracle distributes as Oracle JDK. Other vendors (e.g. RedHat for IcedTea) may also use OpenJDK as their starting point.
In terms of the differences between OpenJDK and a vendor VM, there may be patches which a vendor wants to apply but which the overall OpenJDK community has not accepted into mainline.
Vendor VMs must, of course, be able to prove that they are in conformance with the TCK if they want to use the Java trademarks to describe their product.
Oracle JDK is also not open-source. This is possible because of Java's dual licensing arrangements, and the fact that Oracle own Java overall.
Do you have more specific questions - as posed, your question is a bit vague. What specific aspects are you interested in?