Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
ProB Rodin Plugin
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
general
stups
ProB Rodin Plugin
Commits
94d9b7c9
Commit
94d9b7c9
authored
5 years ago
by
Michael Leuschel
Browse files
Options
Downloads
Patches
Plain Diff
get java -version info before launching ProB2UI
parent
52a75e16
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
de.prob.ui/src/de/prob/ui/eventb/OpenClassicHandler.java
+14
-6
14 additions, 6 deletions
de.prob.ui/src/de/prob/ui/eventb/OpenClassicHandler.java
with
14 additions
and
6 deletions
de.prob.ui/src/de/prob/ui/eventb/OpenClassicHandler.java
+
14
−
6
View file @
94d9b7c9
...
@@ -112,6 +112,18 @@ public class OpenClassicHandler extends AbstractHandler implements IHandler {
...
@@ -112,6 +112,18 @@ public class OpenClassicHandler extends AbstractHandler implements IHandler {
// final String command = "java -jar " + probBinary + " --machine-file " + modelFile;
// final String command = "java -jar " + probBinary + " --machine-file " + modelFile;
//process = Runtime.getRuntime().exec(command);
//process = Runtime.getRuntime().exec(command);
// get some version info first:
final
String
[]
vcommand
=
{
"java"
,
"-version"
};
ProcessBuilder
vpb
=
new
ProcessBuilder
(
vcommand
).
redirectErrorStream
(
true
);
Process
vprocess
=
vpb
.
start
();
final
BufferedReader
voutput
=
new
BufferedReader
(
new
InputStreamReader
(
vprocess
.
getInputStream
()));
new
Thread
(
new
ClassicConsole
(
voutput
)).
start
();
vprocess
.
waitFor
();
// this blocks Rodin
if
(
vprocess
.
exitValue
()
!=
0
)
{
Logger
.
notifyUserWithoutBugreport
(
"Failed to start java -version. Exit code: "
+
vprocess
.
exitValue
());
}
final
String
[]
command
=
{
"java"
,
"-jar"
,
probBinary
,
"--machine-file"
,
modelFile
};
final
String
[]
command
=
{
"java"
,
"-jar"
,
probBinary
,
"--machine-file"
,
modelFile
};
System
.
out
.
println
(
"Launching ProB2UI using: java -jar "
+
probBinary
);
System
.
out
.
println
(
"Launching ProB2UI using: java -jar "
+
probBinary
);
LimitedLogger
.
getLogger
().
log
(
"Launching ProB2UI using: java -jar "
+
probBinary
+
" --machine-file "
+
modelFile
,
"ProB2UI"
,
null
);
LimitedLogger
.
getLogger
().
log
(
"Launching ProB2UI using: java -jar "
+
probBinary
+
" --machine-file "
+
modelFile
,
"ProB2UI"
,
null
);
...
@@ -122,12 +134,8 @@ public class OpenClassicHandler extends AbstractHandler implements IHandler {
...
@@ -122,12 +134,8 @@ public class OpenClassicHandler extends AbstractHandler implements IHandler {
new
InputStreamReader
(
process
.
getInputStream
()));
new
InputStreamReader
(
process
.
getInputStream
()));
new
Thread
(
new
ClassicConsole
(
output
)).
start
();
new
Thread
(
new
ClassicConsole
(
output
)).
start
();
// process.waitFor(); // this blocks Rodin
}
catch
(
IOException
|
InterruptedException
e
)
{
// if (process.exitValue() != 0) {
// } catch (IOException e) {
// Logger.notifyUserWithoutBugreport("Failed to launch ProB2UI with java -jar" + probBinary + ". Exit code: " + process.exitValue());
// }
// } catch (IOException | InterruptedException e) {
}
catch
(
IOException
e
)
{
Logger
.
notifyUserWithoutBugreport
(
"You need to specify a correct location for "
Logger
.
notifyUserWithoutBugreport
(
"You need to specify a correct location for "
+
PROB2_NAME
+
". See Preferences -> ProB Standalone.\n"
+
PROB2_NAME
+
". See Preferences -> ProB Standalone.\n"
+
PROB2_NAME
+
" location: "
+
probBinary
+
+
PROB2_NAME
+
" location: "
+
probBinary
+
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment