text: I am trying something out combining java and python for some encryption reasons where the encryption code is actually a java file from the provider but I am writing a python code. So what I want is to execute the encryption code on java using
  x = os.system("java file.java")
  print x
  import os
  x = os.system("java HelloWorld")
  print x # This should print HELLO WORLD
  public class HelloWorld {
  public static void main(String[] args) {
  String x;
  x = "Hello World";
  System.out.println(x);
  return "HELLO WORLD";
  }
  }
  HelloWorld.java:7: error: incompatible types: unexpected return value
  return x;
  When you invoke another process there is no returning of values.
  The only thing you could hope for is a numerical return code value.
  What you are actually looking for is this:
  See here for instructions how your python script can read what a subprocess is writing its stdout.
  And for the record: there are no detours. If you intend to do anything "serious" with your java code, then you have to learn enough Java to make that happen. Not understanding that a method that says void can't have a return something statement is a good example for that.
  Same is true for the python side of things. Yes, os.system() is the simply, straight forward way to invoke some process. But if you do even a tiny bit of research on that subject, you might have seen that there is the subprocess module in python ... together with its documentation.