0

I've been tasked to help manage an older java spring repository using java 10. Since java 10 are no longer supported I've been unable to use it on my laptop.
I use IntelliJ IDEA as my IDE and have downloaded the JDK from OpenJDK Archive. Since I am using ubuntu i also follow this answer to install it.
Somehow, when I tried to connect the JDK to my IDE gradle shows this error:

Unable to start the daemon process.
This problem might be caused by incorrect configuration of the daemon.
For example, an unrecognized jvm option is used.
Please refer to the User Manual chapter on the daemon at https://docs.gradle.org/7.4/userguide/gradle_daemon.html
Process command line: /home/bbr/Downloads/jdk-10.0.2/bin/java --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.lang.invoke=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.prefs/java.util.prefs=ALL-UNNAMED --add-opens java.prefs/java.util.prefs=ALL-UNNAMED --add-opens java.base/java.nio.charset=ALL-UNNAMED --add-opens java.base/java.net=ALL-UNNAMED --add-opens java.base/java.util.concurrent.atomic=ALL-UNNAMED -XX:MaxMetaspaceSize=256m -XX:+HeapDumpOnOutOfMemoryError -Xms256m -Xmx512m -Dfile.encoding=UTF-8 -Duser.country=US -Duser.language=en -Duser.variant -cp /home/bbr/.gradle/wrapper/dists/gradle-7.4-bin/c0gwcg53nkjbqw7r0h0umtfvt/gradle-7.4/lib/gradle-launcher-7.4.jar org.gradle.launcher.daemon.bootstrap.GradleDaemon 7.4
Please read the following process output to find out more:
-----------------------
java.lang.Error: java.net.URISyntaxException: Ill_______________- 7.4/lib/gradle-launcher-7.4.jar
    at java.base/java.io.File.toURI(File.java:738)
    at org.gradle.internal.classloader.ClassLoaderVisitor.extractJava9Classpath(ClassLoaderVisitor.java:74)
    at org.gradle.internal.classloader.ClassLoaderVisitor.visit(ClassLoaderVisitor.java:51)
    at org.gradle.internal.classloader.ClasspathUtil.collectClasspathOf(ClasspathUtil.java:77)
    at org.gradle.internal.classloader.ClasspathUtil.getClasspath(ClasspathUtil.java:59)
    at org.gradle.api.internal.classpath.EffectiveClassPath.findAvailableClasspathFiles(EffectiveClassPath.java:36)
    at org.gradle.api.internal.classpath.EffectiveClassPath.<init>(EffectiveClassPath.java:32)
    at org.gradle.api.internal.classpath.DefaultModuleRegistry.<init>(DefaultModuleRegistry.java:70)
    at org.gradle.api.internal.classpath.DefaultModuleRegistry.<init>(DefaultModuleRegistry.java:64)
    at org.gradle.api.internal.classpath.DefaultModuleRegistry.<init>(DefaultModuleRegistry.java:60)
    at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:46)
    at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:37)
    at org.gradle.launcher.daemon.bootstrap.GradleDaemon.main(GradleDaemon.java:22)
Caused by: java.net.URISyntaxException: Illegal character in path at index 32: file:/home/bbr/.gradle/wrapp                                     w7r0h0umtfvt/gradle-7.4/lib/gradle-launcher-7.4.jar
    at java.base/java.net.URI$Parser.fail(URI.java:2915)
    at java.base/java.net.URI$Parser.checkChars(URI.java:3086)
    at java.base/java.net.URI$Parser.parseHierarchical(URI.java:3168)
    at java.base/java.net.URI$Parser.parse(URI.java:3116)
    at java.base/java.net.URI.<init>(URI.java:685)
    at java.base/java.net.URI.<init>(URI.java:786)
    at java.base/java.io.File.toURI(File.java:736)
    ... 12 more

After checking around I also found that javac output this error when I type javac on the terminal:

Usage: javac <options> <source files>
where possible options include:
    optiile
  -Akey[=value]                Options to pass to annotation processors
  --add-modules <module>(,<module>)*
        Root modules to resolve in addition to the initial modules, or all modules
        on the module path if <module> is ALL-MODULE-PATH.
  --boot-class-path <path>, -bootclasspath <path>
        Override location of bootstrap class files
  --class-path <path>, -classpath <path>, -cp <path>
        Specify where to find user class files and annotation processors
  -d <directory>               Specify where to place generated class files
  -deprecation
        Output source locations where deprecated APIs are used
  -encoding <encoding>         Specify character encoding used by source files
  -endorseddirs <dirs>         Override location of endorsed standards path
  -extdirs <dirs>              Override location of installed extensions
  -g                           Generate all debugging info
  -g:{lines,vars,source}       Generate only some debugging info
  -g:none                      Generate no debugging info
  -h <directory>
        Specify where to place generated native header files
  --help, -help                Print this help message
  --help-extra, -X             Print help on extra options
  -implicit:{none,class}
        Specify whether or not to generate class files for implicitly referenced files
  -J<flag>                     Pass <flag> directly to the runtime system
  --limit-modules <module>(,<module>)*
        Limit the universe of observable modules
  --module <module-name>, -m <module-name>
        Compile only the specified module, check timestamps
  --module-path <path>, -p <path>
        Specify where to find application modules
  --module-source-path <module-source-path>
        Specify where to find input source files for multiple modules
  --module-version <version>
        Specify version of modules that are being compiled
  -nowarn                      Generate no warnings
  -parameters
        Generate metadata for reflection on method parameters
  -proc:{none,only}
        Control whether annotation processing and/or compilation is done.
  -processor <class1>[,<class2>,<class3>...]
        Names of the annotation processors to run; bypasses default discovery process
  --processor-module-path <path>
        Specify a module path where to find annotation processors
  --processor-path <path>, -processorpath <path>
        Specify where to find annotation processors
  -profile <profile>
        Check that API used is available in the specified profile
Exception in thread "main" java.util.ServiceConfigurationErm.Plaed
    at java.base/java.util.ServiceL1)
    at java.base/java.util.ServiceLoader.access$100(ServiceLoader.java:390)
    at java.base/java.util.ServiceLoader$ProviderImpl.newInstance(ServiceLoader.java:803)
    at java.base/java.util.ServiceLoader$ProviderImpl.get(ServiceLoader.java:721)
    at java.base/java.util.ServiceLoader$3.next(ServiceLoader.java:1394)
    at java.base/java.util.Iterator.forEachRemaining(Iterator.java:133)
    at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
    at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
    at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
    at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913)
    at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
    at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:578)
    at jdk.compiler/com.sun.tools.javac.main.Option$14.help(Option.java:317)
    at jdk.compiler/com.sun.tools.javac.main.Option.lambda$showHelp$1(Option.java:965)
    at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
    at java.base/java.util.ArrayList.forEach(ArrayList.java:1378)
    at java.base/java.util.stream.SortedOps$RefSortingSink.end(SortedOps.java:395)
    at java.base/java.util.stream.Sink$ChainedReference.end(Sink.java:258)
    at java.base/java.util.stream.Aeline.java:485)
    at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
    at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
    at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
    at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
    at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:497)
    at jdk.compiler/com.sun.tools.javac.main.Option.showHelp(Option.java:964)
    at jdk.compiler/com.sun.tools.javac.main.Option.access$300(Option.java:86)
    at jdk.compiler/com.sun.tools.javac.main.Option$18.process(Option.java:369)
    at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:202)
    at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:165)
    at jdk.compiler/com.sun.tools.javac.Main.compile(Main.java:57)
    at jdk.compiler/com.sun.tools.javac.Main.main(Main.java:43)
Caused by: java.lang.ExceptionInInitializerError
    at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:488)
    at java.base/java.util.ServiceLoader$ProviderImpl.newInstance(ServiceLoader.java:779)
    ... 28 more
Caused by: java.lang.IllegalArgumentException: Illegal character in path at index 32: jrt:/java.base/META-INF/servicesvider
    at java.base/java.net.URI.create(URI.java:883)
    at java.base/jdk.internal.module.SystemModuleFinders$SystemModuleReader.find(SystemModuleFinders.java:439)
    at java.base/jdk.internal.loader.BuiltinClassLoader$2.run(BuiltinClassLoader.java:408)
    at java.base/jdk.internal.loader.BuiltinClassLoader$2.run(BuiltinClassLoader.java:403)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at java.base/jdk.internal.loader.BuiltinClassLoader.findMiscResource(BuiltinClassLoader.java:402)
    at java.base/jdk.internal.loader.BuiltinClassLoader.findResources(BuiltinClassLoader.java:333)
    at java.base/jdk.internal.loader.BootLoader.findResources(BootLoader.java:161)
    at java.base/java.lang.ClassLoader.getResources(ClassLoader.java:1457)
    at java.base/java.lang.ClassLoader.getResources(ClassLoader.java:1455)
    at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.nextProviderClass(ServiceLoader.java:1195)
    at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.hasNextService(ServiceLoader.java:1220)
    at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.hasNext(ServiceLoader.java:1264)
    at java.base/java.util.ServiceLoader$2.hasNext(ServiceLoader.java:1299)
    at java.base/java.util.ServiceLoader$3.hasNext(ServiceLoader.java:1384)
    at java.base/java.nio.file.spi.FileSystemProvider.loadInstalledProviders(FileSystemProvider.java:119)
    at java.base/java.nio.file.spi.FileSystemProvider.access$000(FileSystemProvider.java:77)
    at java.base/java.nio.file.spi.FileSystemProvider$1.run(FileSystemProvider.java:169)
    at java.base/java.nio.file.spi.FileSystemProvider$1.run(FileSystemProvider.java:166)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at java.base/java.nio.file.spi.FileSystemProvider.installedProviders(FileSystemProvider.java:166)
    at java.base/java.nio.file.FileSystems.newFileSystem(FileSystems.java:411)
    at jdk.compiler/com.sun.tools.javac.platform.JDKPlatformProvider.<clinit>(JDKPlatformProvider.java:97)
    ... 33 more
Caused by: java.net.URISyntaxException: Illegal character in path at index 32: jrt:/java.base/META-INF/servicesvider
    at java.base/java.net.URI$Parser.fail(URI.java:2915)
    at java.base/java.net.URI$Parser.checkChars(URI.java:3086)
    at java.base/java.net.URI$Parser.parseHierarchical(URI.java:3168)
    at java.base/java.net.URI$Parser.parse(URI.java:3116)
    at java.base/java.net.URI.<init>(URI.java:600)
    at java.base/java.net.URI.create(URI.java:881)
    ... 55 more

I have used other jdk for example by installing it from sdkman and it still output the same error. I have no idea why this happens and when I tried it on my friends computer (running manjaro) it works out just fine.

Can anyone help me with this?
Sorry for the bad grammar since english is not my first language.

Edit:
I use the manual installation since the ppa no longer supports java 10.
I have selected jdk 10 in IDEA both in
Project Settings > Project > SDK
and in
Gradle > Gradle JVM

Edit 2:

  1. I am using Intel based system.
  2. The result of javac 2>error.txt shows a possibility of encoding error as shown in the image here: Gedit Screenshot

I have tried using UTF-8 and ISO-8859-15 encoding and both have shown the same character error \00\ multiple times.

  1. The result of alias is shown below and does not show any information about java.
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
alias egrep='egrep --color=auto'
alias fgrep='fgrep --color=auto'
alias grep='grep --color=auto'
alias l='ls -CF'
alias la='ls -A'
alias ll='ls -alF'
alias ls='ls --color=auto
  • Which of the ways in the linked SO answer did you take? Easy with the PPA or manual installation? Did you add the JDK to the available JDKs in IDEA? Did you select it in the project properties as the JDK to use for your project? – cyberbrain Aug 12 '22 at 12:52
  • @cyberbrain I have updated the question, I use the manual installation and have selected it on the project properties. When using JDK 11 on the IDEA no problem seems to occur. – Blue Birman Aug 12 '22 at 13:24
  • I tried to install with the same steps as you, but got no errors. Can you please check your downloaded archive with the `sha256sum` tool and compare it with the provided checksum on the website? Also please extract and move the files again - I think that some files could be damaged. Then execute the command line call first to check the version and without any parameters where you got the error before. – cyberbrain Aug 13 '22 at 10:34
  • @cyberbrain I have compare the checksum and the sha256sum result for the archive and both are equal. I have extracted and check the version of javac and it gives the right version `javac 10.0.2`. But it spill out the same error when trying to show javac help by either calling `javac` or `javac --help`. – Blue Birman Aug 13 '22 at 14:45
  • by just reading your outputs again: you call "/home/bbr/Downloads/jdk-10.0.2/bin/java" ?? In the instructions it says you shall copy the folder to _/usr/lib/jvm/java-10-openjdk-amd64_ and call `update-alternatives` several times. After that you should be able to call `java` and `javac` from any folder - did you try that as well? – cyberbrain Aug 13 '22 at 16:34
  • @cyberbrain I have tried both ways and it gives the same error. It doesn't make sense to me since it's only happening on my laptop. The other linux machine i have work just fine. I thought it was an OS problem but I have check the environment variables and can not find any that mentions java or jdk. – Blue Birman Aug 14 '22 at 07:57
  • It seems that the error message is mixed with some other message. could you try to separate stdout from stderr with this redirection: `javac 2>error.txt`- this will send the stderr output (where I expect the exception stacktrace) to the extra file _error.txt_. And just to be sure: your laptop _has_ a CPU with amd64 architecture, right? – cyberbrain Aug 14 '22 at 17:53
  • oh and just one more: do you have any shell aliases set? Check it by executing just `alias` in your terminal. (This could cause the java compiler to always be started with some parameters.) – cyberbrain Aug 14 '22 at 17:56
  • @cyberbrain I have updated the question with the error.txt screenshot and the result of `alias`. I am currently using an intel CPU, but I don't believe there are different JDK on the [OpenJDK](https://jdk.java.net/archive/) archive for different CPU and when I put the JDK anywhere else on the disk it spills out the same error. – Blue Birman Aug 15 '22 at 01:14
  • It's unlikely that anything still supports Java 10 - it's nearly 4 years past it's end of life. I can't imagine that a recent IntelliJ still works with it. Even an old Spring should work with Java 8 which is still supported. – stdunbar Aug 15 '22 at 01:16
  • @stdunbar the error is also happening if the OP calls the binary `javac` standalone, without any parameters. This should not happen, not even with a java version at EOL. – cyberbrain Aug 15 '22 at 16:54
  • The stacktrace in the screenshot let's me think that there is an error on reading _/usr/lib/jvm/java-10-openjdk-amd64/jmods/java.base.jmod_. Can you execute `jmod list /usr/lib/jvm/java-10-openjdk-amd64/jmods/java.base.jmod|grep META-INF` and write the result? on my machine it only outputs one line. Do you have other versions of Java installed in parallel on your machine? If yes, which ones? What does this output: `readlink -f /usr/bin/jmod` ? – cyberbrain Aug 15 '22 at 17:12
  • @cyberbrain the result of `jmod list ...` is this `classes/META-INF/services/java.nio.file.spi.FileSystemProvider`. And I have removed my java 11 that was installed and removed using apt. The result of `readlink` is `/usr/bin/jmod` – Blue Birman Aug 16 '22 at 02:24
  • OK, /usr/bin/jmod as result for the readlink is strange - I would have expected that to point somewhere into another java installation. Could you please try to reinstall Java 11 or Java 17 via package manager again please? and see, if the readlink result then shows something from that /usr/lib/jvm/... folder? Thing is that the install instructions only set two alternatives, but there are many more for a java installation, maybe one of them is needed. – cyberbrain Aug 16 '22 at 06:24
  • @cyberbrain after installing java 11 using apt, readlink shows `/usr/lib/jvm/java-11-openjdk-amd64/bin/jmod` – Blue Birman Aug 18 '22 at 02:24
  • did you try javac from java 10 now? (don't forget to switch the alternatives back to java 10 like it was described in the installation instructions) – cyberbrain Aug 18 '22 at 08:44
  • @cyberbrain javac still gives the same error. I do believe that the result of readlink on java 10 gives `/usr/bin/jmod` because it is not linked and I was able to access it because previously the path environment variables contains `.../jvm/java-10-openjdk-amd64/bin`. – Blue Birman Aug 19 '22 at 06:13

0 Answers0