EvA2 cannot be launched using Java Web Start in its current version.
This commit is contained in:
parent
7d281e2bf0
commit
a9c0f3a4cf
@ -840,7 +840,7 @@ public class EvAClient implements RemoteStateListener, Serializable {
|
||||
* @return
|
||||
*/
|
||||
public boolean isOptRunning() {
|
||||
if (currentModuleAdapter != null && (currentModuleAdapter instanceof AbstractModuleAdapter)) {
|
||||
if ((currentModuleAdapter != null) && (currentModuleAdapter instanceof AbstractModuleAdapter)) {
|
||||
return ((AbstractModuleAdapter) currentModuleAdapter).isOptRunning();
|
||||
} else return false;
|
||||
}
|
||||
@ -856,13 +856,19 @@ public class EvAClient implements RemoteStateListener, Serializable {
|
||||
EVAERROR.EXIT("Error while m_ComAdapter.GetModuleAdapter Host: " + e.getMessage());
|
||||
}
|
||||
if (newModuleAdapter == null) {
|
||||
URL baseDir = this.getClass().getClassLoader().getResource("");
|
||||
// When launching a Java Web Start application, baseDir will always be null!
|
||||
URL baseDir = getClass().getClassLoader().getResource("");
|
||||
String cp = System.getProperty("java.class.path",".");
|
||||
if (!cp.contains(baseDir.getPath())) {
|
||||
String dir = (baseDir == null) ? System.getProperty("user.dir") : baseDir.getPath();
|
||||
// System.err.println("Working dir: " + dir);
|
||||
if (baseDir == null) {
|
||||
throw new RuntimeException("Cannot launch EvA2 due to an access restriction. If you are using Java Web Start, please download the application and try again.");
|
||||
}
|
||||
if (!cp.contains(dir)) {
|
||||
// this was added due to matlab not adding base dir to base path...
|
||||
System.err.println("classpath does not contain base directory!");
|
||||
System.err.println("adding base dir and trying again...");
|
||||
System.setProperty("java.class.path", cp + System.getProperty("path.separator") + baseDir.getPath());
|
||||
System.setProperty("java.class.path", cp + System.getProperty("path.separator") + dir);
|
||||
ReflectPackage.resetDynCP();
|
||||
m_ComAdapter.updateLocalMainAdapter();
|
||||
loadSpecificModule(selectedModule, goParams); // end recursive call! handle with care!
|
||||
|
Loading…
x
Reference in New Issue
Block a user