• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Why my Java project doesn't work on different JDK?

 
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I made a simple Java project with the console message "Hello world". Before I created it, I set its JDK to 11.

I wanted to test JDK 16, so I changed it in project structure. After I ran my program, what I get is "cannot determine path to 'tools.jar' library for 16".
Can someone tell me why I can't play around with different JDKs after the program is set up? Does it mean it's stuck forever with JDK 11?
 
Master Rancher
Posts: 4465
38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Your problems sound like they are with your IDE.  Can you describe what IDE you are using?
 
Stefan Jankovic
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hmmm I don't know. I am using IntelliJ.
Staff note (Paul Clapham) :

So I have moved this thread to the IntelliJ IDEA forum.

 
Saloon Keeper
Posts: 24321
167
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You probably have to register your installed JDK 16 with IntelliJ and offhand I don't know the process for that, only for Eclipse.

Note, however that there are two different ways to set the JVM version level. One is to change the setting of the project to use a given level for compiling and running, the other is to install alternative JVMs. You'd need to do the second if you wanted a Java version higher than any of the JVMs already defined to your copy of IntelliJ.
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic