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
df2fd659
Commit
df2fd659
authored
5 years ago
by
Michael Leuschel
Browse files
Options
Downloads
Patches
Plain Diff
use ProcessBuilder to start ProB2 Standalone
parent
365950b2
No related branches found
No related tags found
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
+9
-5
9 additions, 5 deletions
de.prob.ui/src/de/prob/ui/eventb/OpenClassicHandler.java
with
9 additions
and
5 deletions
de.prob.ui/src/de/prob/ui/eventb/OpenClassicHandler.java
+
9
−
5
View file @
df2fd659
...
@@ -107,17 +107,21 @@ public class OpenClassicHandler extends AbstractHandler implements IHandler {
...
@@ -107,17 +107,21 @@ public class OpenClassicHandler extends AbstractHandler implements IHandler {
// from command-line it is: java -jar prob2-ui-1.0.1-SNAPSHOT-all.jar --machine-file FILE
// from command-line it is: java -jar prob2-ui-1.0.1-SNAPSHOT-all.jar --machine-file FILE
Process
process
=
null
;
Process
process
=
null
;
try
{
try
{
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);
final
BufferedReader
output
=
new
BufferedReader
(
//final BufferedReader output = new BufferedReader(
new
InputStreamReader
(
process
.
getInputStream
()));
// new InputStreamReader(process.getInputStream()));
new
Thread
(
new
ClassicConsole
(
output
)).
start
();
//new Thread(new ClassicConsole(output)).start();
final
String
[]
command
=
{
"java"
,
"-jar"
,
probBinary
,
"--machine-file"
,
modelFile
};
process
=
new
ProcessBuilder
(
command
).
redirectErrorStream
().
start
();
// TODO: maybe use
// TODO: maybe use
//ProcessBuilder pb = new ProcessBuilder("/path/to/java", "-jar", probBinary, "--machine-file",modelFile);
//ProcessBuilder pb = new ProcessBuilder("/path/to/java", "-jar", probBinary, "--machine-file",modelFile);
// pb.directory(new File("preferred/working/directory"));
// pb.directory(new File("preferred/working/directory"));
// Process p = pb.start();
// Process p = pb.start();
}
catch
(
IOException
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"
...
...
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