This site requires JavaScript, please enable it in your browser!
Greenfoot back
MrBradley
MrBradley wrote ...

2017/6/5

Greenfoot / JDK configuration

MrBradley MrBradley

2017/6/5

#
How do you configure Greenfoot to use the current version of the JDK that is installed on your computer, given that the PATH is set up correctly in the OS. I use the generic versions - and both seem to have a path_to_Jdk. Is there a way to simply remove this statement and let GF rely on the OS for the correct location? Also on a MacBook how can you edit the startup script (bash script?) Are there configurations files used that store the location of the jdk? Thanks
davmac davmac

2017/6/6

#
Is there a way to simply remove this statement and let GF rely on the OS for the correct location?
There isn't, because the "tools.jar" file needs to be on the classpath when BlueJ starts (due to a long-standing issue with the Javadoc tool). If you really need to do this, you would have to script it somehow.
Also on a MacBook how can you edit the startup script (bash script?)
I assume you mean after installation via the generic "pure Java" installer - you can open it in any text editor. The standard TextEdit application should work fine.
Are there configurations files used that store the location of the jdk?
For the generic version, just the shell script. For the regular Mac package, it is hardcoded to use the bundled JDK,
MrBradley MrBradley

2017/6/7

#
Davin, For the classpath issue, I assume it must be specified in the command line vs being picked up via an OS environment var?
davmac davmac

2017/6/8

#
MrBradley wrote...
For the classpath issue, I assume it must be specified in the command line vs being picked up via an OS environment var?
It must be on the classpath though it doesn't matter how. However, the usual environment variable for specifying a classpath is CLASSPATH, and I'm not sure if its value is used if a classpath is also specified on the command line (which the BlueJ script does) and furthermore the tools.jar file is not normally listed in the CLASSPATH environment variable. You could of course modify the bluej launch script so that it included a value from an environment variable (with any name that you like, not necessarily CLASSPATH) in the classpath that it specifies on the command line (via the "-cp" option to java). You would then of course need to make sure the variable had the path to the correct tools.jar file. I can't think of any way to do this automatically which still works without intervention when you upgrade your system JDK.
You need to login to post a reply.