[
https://issues.apache.org/jira/browse/NETBEANS-6345?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17467311#comment-17467311
]
Thomas Schapitz commented on NETBEANS-6345:
-------------------------------------------
The Answer to this is, that you need to select this independently, and indeed
you can.
1.) You may fix the JDK Netbeans is running on without relying on OS paths and
settings, basically in two ways:
* Using the parameter --jdkhome <path-to-jdk> when starting netbeans on a
command line *OR*
* Within the Netbeans installation directory, edit the file
etc/netbenans.conf: uncomment and change the value of
netbeans_jdkhome="/path/to/jdk" to point to the JDK, that you would like to be
used fro Netbeans itself.
Note: if you use both, the command line will take precedence. You may
also compile a couple of Desktop shortcuts wit a variety of different --jdkhome
Parameters, so you may select them per click, instead of constantly editing
the configuration. But basically, you rarely need this, if proceed to step two:
2.) Now start Netbeans with your selected JDK, and navigate to -> Tools -> Java
Plattform Manager. You will notice, that the JDK you just selected usually
appears to be registered as the single "Default", at least if you started with
an pristine installation. You may now add here any other JDK, that you want to
use for development. This might look something like this:
!image-2021-12-31-22-09-29-276.png!
3.) Throught Netbeans, there are several opportunities were you might pick one
of those JDKs as the one, that should be used for buildung, testing, or
executing your code.
For Ant Projects the relevant location is in the projects properties, available
in the context menu of the project within the 'Libraries' category:
!image-2021-12-31-22-16-08-793.png!
Note, that you may select a matching source/binary version independently in
category 'Sources', but usually it is safest, if the matches the JDK.
Also note, that Netbeans will take care of selecting the proper JDK when
executing the build only, if start from one of the Netbeans menu items. If you
start Ant from the command line, you have to take care of it yourself again.
If this explanation helps, I suggest that you close this issue.
> Project platform libraries missing from project compiler classpath
> ------------------------------------------------------------------
>
> Key: NETBEANS-6345
> URL: https://issues.apache.org/jira/browse/NETBEANS-6345
> Project: NetBeans
> Issue Type: Bug
> Components: java - Compiler
> Affects Versions: 12.6
> Reporter: Arnaud Kleinveld
> Priority: Minor
> Attachments: image-2021-12-31-22-09-29-276.png,
> image-2021-12-31-22-16-08-793.png
>
>
> Configuration of Fedora 34 with java 11 and 1.8 from repo and used
> alternatives set to java 11 as the default. When Netbeans is launched on
> selected version and project platform is specified to be 1.8, the project
> libraries node expands with JDK 1.8 and inline compiler is using this
> correctly, however when the project is built 1.8 specific libraries seem to
> be missing from classpath, e.g. javax.activation.DataSource.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists