This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 217181 - NoGo for plugin Randoop NetBeans Plugin
Summary: NoGo for plugin Randoop NetBeans Plugin
Status: RESOLVED FIXED
Alias: None
Product: updatecenters
Classification: Unclassified
Component: Pluginportal (show other bugs)
Version: 7.2
Hardware: All All
: P3 normal (vote)
Assignee: javydreamercsw
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-21 19:39 UTC by ent38
Modified: 2013-01-19 13:02 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ent38 2012-08-21 19:39:03 UTC
The jre/bin or java(.exe) needs to be in the system's path

http://plugins.netbeans.org/plugin/44076
Comment 1 ent38 2012-08-21 19:39:10 UTC
The jre/bin or java(.exe) needs to be in the system's path
Comment 2 ent38 2012-08-21 19:40:44 UTC
There is a little problem : the plugin launches the Java process, but its location needs to be in the system's classpath.
Many users don't add their jre/bin or java(.exe) folder/file to the path.

Other plugins had the same problem (CodenameOne, JRebel, ...). They solved it by finding the JDK that runs NetBeans, and launching its internal JRE.

Could you take a look at this ?
Thx a lot.
Comment 3 ent38 2012-08-21 19:41:50 UTC
The jre/bin or java(.exe) needs to be in the system's path
Comment 4 javydreamercsw 2012-08-24 14:11:12 UTC
I haven't been able to find how those projects accomplish that. The only workaround I can see valid so far is letting the user know when java is not in the system's path and have that as a plug-in requirement.
Comment 5 ent38 2012-08-24 14:53:12 UTC
You can get the running JDK via the "org.netbeans.api.java.platform.JavaPlatform.getDefault().getInstallFolders()" method.
Check http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-java-platform/org/netbeans/api/java/platform/package-summary.html for details.

Example :

Collection<FileObject> c = JavaPlatform.getDefault().getInstallFolders();
for (FileObject fo : c) {
  theJdkPathIsHere(fo.getPath());
}

The getInstallFolders returns a collection, but it seems to return an only one element : the path of the running JDK (I've tested with different "netbeans_jdkhome" config values : the program returns its value).
Maybe is it able to return JavaFX path, so it would return two elements ? I've not tested.


I do not know if this is the most elegant way to proceed, the NetBeans forum may help.
Hoping that it will be useful :)
Comment 6 ent38 2012-08-24 14:55:49 UTC
According to the documentation : 
"Each JavaPlatform is one installation of a Java platform, such as Java SE, Java EE, or Java ME. It has a specification name like J2SE and a version such as 1.4."

If the method returns many elements, you may be able to filter this list easily.
Comment 7 javydreamercsw 2012-08-24 16:24:32 UTC
Looking into the solution with the provided feedback...
Comment 8 javydreamercsw 2012-09-11 16:28:25 UTC
This will be part of the next release which should include Maven Java SE support as well.
Comment 9 carlosqt 2013-01-19 13:02:23 UTC
Works on NB 7.2.1<br />
Mac OSX 10.7.5<br />
Java 1.7.0_09 64Bit<br />