You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by GitBox <gi...@apache.org> on 2022/07/16 10:35:45 UTC
[GitHub] [netbeans] mbien opened a new pull request, #4390: Notify user about invalid netbeans_jdkhome path (aka "default jdk").
mbien opened a new pull request, #4390:
URL: https://github.com/apache/netbeans/pull/4390
- this will show an error notification when the default jdk is invalid
- updated some related warning messages
- fixes #4365 (installer is still broken though)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[GitHub] [netbeans] neilcsmith-net commented on a diff in pull request #4390: Notify user about invalid netbeans_jdkhome path (aka "default jdk").
Posted by GitBox <gi...@apache.org>.
neilcsmith-net commented on code in PR #4390:
URL: https://github.com/apache/netbeans/pull/4390#discussion_r922665645
##########
java/java.j2seplatform/src/org/netbeans/modules/java/j2seplatform/platformdefinition/DefaultPlatformImpl.java:
##########
@@ -84,6 +102,12 @@ static JavaPlatform create(Map<String,String> properties, List<URL> sources, Lis
return new DefaultPlatformImpl(installFolders, properties, systemProperties, sources, javadoc);
}
+ private static boolean isValidJDKHome(Path javaHome) {
+ return Files.exists(javaHome.resolve(Path.of("bin", "java")))
+ && Files.exists(javaHome.resolve(Path.of("bin", "javac")));
+// && Files.exists(javaHome.resolve(Path.of("jmods", "java.base.mod"))); // TODO: uncomment once everything migrated to 11+
Review Comment:
Did you test this? Because that's probably still returning `true`. The IDE wouldn't launch otherwise. The problem is that those files are symlinks. Are there any circumstances that `java.home` will not be correct? I would either default to that, or at least default to that if `<jdk.home>/bin/java` is a symlink.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[GitHub] [netbeans] mbien commented on a diff in pull request #4390: use java.home as "default jdk" if jdk.home leads to symlinks.
Posted by GitBox <gi...@apache.org>.
mbien commented on code in PR #4390:
URL: https://github.com/apache/netbeans/pull/4390#discussion_r922678971
##########
java/java.j2seplatform/src/org/netbeans/modules/java/j2seplatform/platformdefinition/DefaultPlatformImpl.java:
##########
@@ -84,6 +102,12 @@ static JavaPlatform create(Map<String,String> properties, List<URL> sources, Lis
return new DefaultPlatformImpl(installFolders, properties, systemProperties, sources, javadoc);
}
+ private static boolean isValidJDKHome(Path javaHome) {
+ return Files.exists(javaHome.resolve(Path.of("bin", "java")))
+ && Files.exists(javaHome.resolve(Path.of("bin", "javac")));
+// && Files.exists(javaHome.resolve(Path.of("jmods", "java.base.mod"))); // TODO: uncomment once everything migrated to 11+
Review Comment:
@neilcsmith-net I should have let you do the PR. It probably took you as much time answering my questions as if you would have done it right away. Its just that I had it already started together with the NPE PR and split it later, since i thought this one would require UI.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[GitHub] [netbeans] neilcsmith-net commented on a diff in pull request #4390: Notify user about invalid netbeans_jdkhome path (aka "default jdk").
Posted by GitBox <gi...@apache.org>.
neilcsmith-net commented on code in PR #4390:
URL: https://github.com/apache/netbeans/pull/4390#discussion_r922673212
##########
java/java.j2seplatform/src/org/netbeans/modules/java/j2seplatform/platformdefinition/DefaultPlatformImpl.java:
##########
@@ -42,8 +48,15 @@ public class DefaultPlatformImpl extends J2SEPlatformImpl {
public static final String DEFAULT_PLATFORM_ANT_NAME = "default_platform"; //NOI18N
- private ClassPath standardLibs;
+ @StaticResource
+ private static final String WARNING_ICON = "org/netbeans/modules/java/j2seplatform/resources/warning.png"; //NOI18N
+ @NbBundle.Messages({
+ "TITLE_InvalidDefaultJDK=Invalid JDK Home detected",
+ "DESC_InvalidDefaultJDK=The jdk.home property does not set a path to a valid JDK." +
+ "Please update netbeans_jdkhome in your netbeans.conf" +
+ "or start netbeans with --jdkhome /path/to/JDK set."
Review Comment:
Yes, disregard for this. Although I thought there was code in there to special case html. Will take a look sometime.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[GitHub] [netbeans] mbien commented on a diff in pull request #4390: use java.home as "default jdk" if jdk.home leads to symlinks.
Posted by GitBox <gi...@apache.org>.
mbien commented on code in PR #4390:
URL: https://github.com/apache/netbeans/pull/4390#discussion_r922678971
##########
java/java.j2seplatform/src/org/netbeans/modules/java/j2seplatform/platformdefinition/DefaultPlatformImpl.java:
##########
@@ -84,6 +102,12 @@ static JavaPlatform create(Map<String,String> properties, List<URL> sources, Lis
return new DefaultPlatformImpl(installFolders, properties, systemProperties, sources, javadoc);
}
+ private static boolean isValidJDKHome(Path javaHome) {
+ return Files.exists(javaHome.resolve(Path.of("bin", "java")))
+ && Files.exists(javaHome.resolve(Path.of("bin", "javac")));
+// && Files.exists(javaHome.resolve(Path.of("jmods", "java.base.mod"))); // TODO: uncomment once everything migrated to 11+
Review Comment:
@neilcsmith-net I should have let you do the PR. It probably took you as much time answering my questions as if you would have done it right away. Its just that I had it already started together with the NPE PR and split it later.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[GitHub] [netbeans] mbien commented on pull request #4390: use java.home if jdk.home leads to symlinks as "default jdk".
Posted by GitBox <gi...@apache.org>.
mbien commented on PR #4390:
URL: https://github.com/apache/netbeans/pull/4390#issuecomment-1186172720
tested the following:
1) set netbeans_jdkhome to `/usr`
2) started NB and made sure platform had been changed to `/usr/lib/jvm/java-18-openjdk`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[GitHub] [netbeans] mbien commented on a diff in pull request #4390: Notify user about invalid netbeans_jdkhome path (aka "default jdk").
Posted by GitBox <gi...@apache.org>.
mbien commented on code in PR #4390:
URL: https://github.com/apache/netbeans/pull/4390#discussion_r922669826
##########
java/java.j2seplatform/src/org/netbeans/modules/java/j2seplatform/platformdefinition/DefaultPlatformImpl.java:
##########
@@ -84,6 +102,12 @@ static JavaPlatform create(Map<String,String> properties, List<URL> sources, Lis
return new DefaultPlatformImpl(installFolders, properties, systemProperties, sources, javadoc);
}
+ private static boolean isValidJDKHome(Path javaHome) {
+ return Files.exists(javaHome.resolve(Path.of("bin", "java")))
+ && Files.exists(javaHome.resolve(Path.of("bin", "javac")));
+// && Files.exists(javaHome.resolve(Path.of("jmods", "java.base.mod"))); // TODO: uncomment once everything migrated to 11+
Review Comment:
I tested this with the jmods line uncommented, but then I realized that this is probably used by VSCode too.
So you are saying the `jdk.home` property has no use at this point in the lifecycle anymore, I should simply change it to `java.home`, do no validation and therefore also no notifications since it can't ever be wrong at this point?
```java
File javaHome;
if (Util.getSpecificationVersion((String) p.get("java.specification.version")).compareTo(Util.JDK9) < 0) {
javaHome = FileUtil.normalizeFile(new File(System.getProperty("java.home")).getParentFile()); // NOI18N
} else {
javaHome = FileUtil.normalizeFile(new File(System.getProperty("java.home"))); // NOI18N
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[GitHub] [netbeans] mbien commented on a diff in pull request #4390: Notify user about invalid netbeans_jdkhome path (aka "default jdk").
Posted by GitBox <gi...@apache.org>.
mbien commented on code in PR #4390:
URL: https://github.com/apache/netbeans/pull/4390#discussion_r922673882
##########
java/java.j2seplatform/src/org/netbeans/modules/java/j2seplatform/platformdefinition/DefaultPlatformImpl.java:
##########
@@ -84,6 +102,12 @@ static JavaPlatform create(Map<String,String> properties, List<URL> sources, Lis
return new DefaultPlatformImpl(installFolders, properties, systemProperties, sources, javadoc);
}
+ private static boolean isValidJDKHome(Path javaHome) {
+ return Files.exists(javaHome.resolve(Path.of("bin", "java")))
+ && Files.exists(javaHome.resolve(Path.of("bin", "javac")));
+// && Files.exists(javaHome.resolve(Path.of("jmods", "java.base.mod"))); // TODO: uncomment once everything migrated to 11+
Review Comment:
ok changed, this makes things easier. Although having jdk.home set to /usr seems to be a fairly specific misconfiguration scenario. I am sure there are more creative ways how to have an invalid jdk.home set? I guess we will see in future :)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[GitHub] [netbeans] mbien commented on a diff in pull request #4390: Notify user about invalid netbeans_jdkhome path (aka "default jdk").
Posted by GitBox <gi...@apache.org>.
mbien commented on code in PR #4390:
URL: https://github.com/apache/netbeans/pull/4390#discussion_r922669826
##########
java/java.j2seplatform/src/org/netbeans/modules/java/j2seplatform/platformdefinition/DefaultPlatformImpl.java:
##########
@@ -84,6 +102,12 @@ static JavaPlatform create(Map<String,String> properties, List<URL> sources, Lis
return new DefaultPlatformImpl(installFolders, properties, systemProperties, sources, javadoc);
}
+ private static boolean isValidJDKHome(Path javaHome) {
+ return Files.exists(javaHome.resolve(Path.of("bin", "java")))
+ && Files.exists(javaHome.resolve(Path.of("bin", "javac")));
+// && Files.exists(javaHome.resolve(Path.of("jmods", "java.base.mod"))); // TODO: uncomment once everything migrated to 11+
Review Comment:
I tested this with the jmods line uncommented, but then I realized that this is probably used by VSCode too.
So you are saying the `jdk.home` property has no use at this point in the lifecycle anymore, I should simply change it to `java.home`, do no validation and therefore also no notifications since it can't ever be wrong at this point?
```java
File javaHome;
if (Util.getSpecificationVersion((String) p.get("java.specification.version")).compareTo(Util.JDK9) < 0) {
javaHome = FileUtil.normalizeFile(new File(System.getProperty("java.home")).getParentFile()); // NOI18N
} else {
javaHome = FileUtil.normalizeFile(new File(System.getProperty("java.home"))); // NOI18N
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[GitHub] [netbeans] mbien commented on a diff in pull request #4390: Notify user about invalid netbeans_jdkhome path (aka "default jdk").
Posted by GitBox <gi...@apache.org>.
mbien commented on code in PR #4390:
URL: https://github.com/apache/netbeans/pull/4390#discussion_r922669826
##########
java/java.j2seplatform/src/org/netbeans/modules/java/j2seplatform/platformdefinition/DefaultPlatformImpl.java:
##########
@@ -84,6 +102,12 @@ static JavaPlatform create(Map<String,String> properties, List<URL> sources, Lis
return new DefaultPlatformImpl(installFolders, properties, systemProperties, sources, javadoc);
}
+ private static boolean isValidJDKHome(Path javaHome) {
+ return Files.exists(javaHome.resolve(Path.of("bin", "java")))
+ && Files.exists(javaHome.resolve(Path.of("bin", "javac")));
+// && Files.exists(javaHome.resolve(Path.of("jmods", "java.base.mod"))); // TODO: uncomment once everything migrated to 11+
Review Comment:
I tested this with the jmods line uncommented, but then I realized that this is probably used by VSCode too.
So you are saying the `jdk.home` property has no use at this point in the lifecycle anymore, I should simply change it to `java.home`, do no validation and therefore also no notifications since it can't ever be wrong at this point?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[GitHub] [netbeans] mbien merged pull request #4390: use java.home as "default jdk" if jdk.home leads to symlinks.
Posted by GitBox <gi...@apache.org>.
mbien merged PR #4390:
URL: https://github.com/apache/netbeans/pull/4390
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[GitHub] [netbeans] neilcsmith-net commented on a diff in pull request #4390: Notify user about invalid netbeans_jdkhome path (aka "default jdk").
Posted by GitBox <gi...@apache.org>.
neilcsmith-net commented on code in PR #4390:
URL: https://github.com/apache/netbeans/pull/4390#discussion_r922673059
##########
java/java.j2seplatform/src/org/netbeans/modules/java/j2seplatform/platformdefinition/DefaultPlatformImpl.java:
##########
@@ -84,6 +102,12 @@ static JavaPlatform create(Map<String,String> properties, List<URL> sources, Lis
return new DefaultPlatformImpl(installFolders, properties, systemProperties, sources, javadoc);
}
+ private static boolean isValidJDKHome(Path javaHome) {
+ return Files.exists(javaHome.resolve(Path.of("bin", "java")))
+ && Files.exists(javaHome.resolve(Path.of("bin", "javac")));
+// && Files.exists(javaHome.resolve(Path.of("jmods", "java.base.mod"))); // TODO: uncomment once everything migrated to 11+
Review Comment:
Well, I was going to put in a PR along the lines of the second option. Think that's probably safer? Using `jdk.home` was presumably added for some reason.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[GitHub] [netbeans] neilcsmith-net commented on a diff in pull request #4390: Notify user about invalid netbeans_jdkhome path (aka "default jdk").
Posted by GitBox <gi...@apache.org>.
neilcsmith-net commented on code in PR #4390:
URL: https://github.com/apache/netbeans/pull/4390#discussion_r922666047
##########
java/java.j2seplatform/src/org/netbeans/modules/java/j2seplatform/platformdefinition/DefaultPlatformImpl.java:
##########
@@ -42,8 +48,15 @@ public class DefaultPlatformImpl extends J2SEPlatformImpl {
public static final String DEFAULT_PLATFORM_ANT_NAME = "default_platform"; //NOI18N
- private ClassPath standardLibs;
+ @StaticResource
+ private static final String WARNING_ICON = "org/netbeans/modules/java/j2seplatform/resources/warning.png"; //NOI18N
+ @NbBundle.Messages({
+ "TITLE_InvalidDefaultJDK=Invalid JDK Home detected",
+ "DESC_InvalidDefaultJDK=The jdk.home property does not set a path to a valid JDK." +
+ "Please update netbeans_jdkhome in your netbeans.conf" +
+ "or start netbeans with --jdkhome /path/to/JDK set."
Review Comment:
I assume you tested the message starting with `<html>`?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[GitHub] [netbeans] mbien commented on a diff in pull request #4390: Notify user about invalid netbeans_jdkhome path (aka "default jdk").
Posted by GitBox <gi...@apache.org>.
mbien commented on code in PR #4390:
URL: https://github.com/apache/netbeans/pull/4390#discussion_r922664218
##########
java/java.j2seplatform/src/org/netbeans/modules/java/j2seplatform/platformdefinition/DefaultPlatformImpl.java:
##########
@@ -42,8 +48,15 @@ public class DefaultPlatformImpl extends J2SEPlatformImpl {
public static final String DEFAULT_PLATFORM_ANT_NAME = "default_platform"; //NOI18N
- private ClassPath standardLibs;
+ @StaticResource
+ private static final String WARNING_ICON = "org/netbeans/modules/java/j2seplatform/resources/warning.png"; //NOI18N
+ @NbBundle.Messages({
+ "TITLE_InvalidDefaultJDK=Invalid JDK Home detected",
+ "DESC_InvalidDefaultJDK=The jdk.home property does not set a path to a valid JDK." +
+ "Please update netbeans_jdkhome in your netbeans.conf" +
+ "or start netbeans with --jdkhome /path/to/JDK set."
Review Comment:
how comes that `NotificationDisplayer` doesn't support html or `\n` line breaks? This creates a fairly long line.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[GitHub] [netbeans] mbien commented on a diff in pull request #4390: Notify user about invalid netbeans_jdkhome path (aka "default jdk").
Posted by GitBox <gi...@apache.org>.
mbien commented on code in PR #4390:
URL: https://github.com/apache/netbeans/pull/4390#discussion_r922669986
##########
java/java.j2seplatform/src/org/netbeans/modules/java/j2seplatform/platformdefinition/DefaultPlatformImpl.java:
##########
@@ -42,8 +48,15 @@ public class DefaultPlatformImpl extends J2SEPlatformImpl {
public static final String DEFAULT_PLATFORM_ANT_NAME = "default_platform"; //NOI18N
- private ClassPath standardLibs;
+ @StaticResource
+ private static final String WARNING_ICON = "org/netbeans/modules/java/j2seplatform/resources/warning.png"; //NOI18N
+ @NbBundle.Messages({
+ "TITLE_InvalidDefaultJDK=Invalid JDK Home detected",
+ "DESC_InvalidDefaultJDK=The jdk.home property does not set a path to a valid JDK." +
+ "Please update netbeans_jdkhome in your netbeans.conf" +
+ "or start netbeans with --jdkhome /path/to/JDK set."
Review Comment:
it simply rendered with the html tags in plain text. but disregard this, we probably don't need any notification.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[GitHub] [netbeans] mbien commented on a diff in pull request #4390: Notify user about invalid netbeans_jdkhome path (aka "default jdk").
Posted by GitBox <gi...@apache.org>.
mbien commented on code in PR #4390:
URL: https://github.com/apache/netbeans/pull/4390#discussion_r922669986
##########
java/java.j2seplatform/src/org/netbeans/modules/java/j2seplatform/platformdefinition/DefaultPlatformImpl.java:
##########
@@ -42,8 +48,15 @@ public class DefaultPlatformImpl extends J2SEPlatformImpl {
public static final String DEFAULT_PLATFORM_ANT_NAME = "default_platform"; //NOI18N
- private ClassPath standardLibs;
+ @StaticResource
+ private static final String WARNING_ICON = "org/netbeans/modules/java/j2seplatform/resources/warning.png"; //NOI18N
+ @NbBundle.Messages({
+ "TITLE_InvalidDefaultJDK=Invalid JDK Home detected",
+ "DESC_InvalidDefaultJDK=The jdk.home property does not set a path to a valid JDK." +
+ "Please update netbeans_jdkhome in your netbeans.conf" +
+ "or start netbeans with --jdkhome /path/to/JDK set."
Review Comment:
it simply rendered with the html tags in plain text. but Disregard this, we probably don't need a notification.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[GitHub] [netbeans] mbien commented on a diff in pull request #4390: Notify user about invalid netbeans_jdkhome path (aka "default jdk").
Posted by GitBox <gi...@apache.org>.
mbien commented on code in PR #4390:
URL: https://github.com/apache/netbeans/pull/4390#discussion_r922669826
##########
java/java.j2seplatform/src/org/netbeans/modules/java/j2seplatform/platformdefinition/DefaultPlatformImpl.java:
##########
@@ -84,6 +102,12 @@ static JavaPlatform create(Map<String,String> properties, List<URL> sources, Lis
return new DefaultPlatformImpl(installFolders, properties, systemProperties, sources, javadoc);
}
+ private static boolean isValidJDKHome(Path javaHome) {
+ return Files.exists(javaHome.resolve(Path.of("bin", "java")))
+ && Files.exists(javaHome.resolve(Path.of("bin", "javac")));
+// && Files.exists(javaHome.resolve(Path.of("jmods", "java.base.mod"))); // TODO: uncomment once everything migrated to 11+
Review Comment:
I tested this with the jmods line uncommented, but then I realized that this is probably used by VSCode too.
So you are saying the `jdk.home` property has no use at this point in the lifecycle anymore, I should simply change it to `java.home`, do no validation and therefore also no notifications since it can't ever be wrong at this point?
```java
File javaHome;
if (Util.getSpecificationVersion((String) p.get("java.specification.version")).compareTo(Util.JDK9) < 0) {
javaHome = FileUtil.normalizeFile(new File(System.getProperty("java.home")).getParentFile()); // NOI18N
} else {
javaHome = FileUtil.normalizeFile(new File(System.getProperty("java.home"))); // NOI18N
}
```
or
```java
String jdkHome = System.getProperty("jdk.home"); // NOI18N
File javaHome;
if (jdkHome == null || Files.isSymbolicLink(Paths.get(jdkHome, "bin", "java"))) {
if (Util.getSpecificationVersion((String) p.get("java.specification.version")).compareTo(Util.JDK9) < 0) {
javaHome = FileUtil.normalizeFile(new File(System.getProperty("java.home")).getParentFile()); // NOI18N
} else {
javaHome = FileUtil.normalizeFile(new File(System.getProperty("java.home"))); // NOI18N
}
} else {
javaHome = FileUtil.normalizeFile(new File(jdkHome));
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists