1

I have an Intellij project. I compile ('Make') it on Windows, and sends it onto a Ubuntu 14.04 remote server, running Java 1.8.

My problem is that the System.out.println() outside of the main method prints nothing. I've spent a few hours on this problem, and I can ensure that :

  • I know the methods are executed because they raise Warnings :
    Aug 20, 2016 7:35:36 PM org.apache.pdfbox.cos.COSDocument finalize WARNING: Warning: You did not close a PDF Document

  • When the execution ends, I always get the following output for rates : []

  • Printing the methods as I call them & place print lines at the begining of these methods, won't do the stuff.

N.B. To execute my project, I use : java MyProject.TestAlgo , with TestAlgo the main Class.


EDIT : I expect the output to be a List such as : [1.0, 2.3, ..., 5.4], but I get []

I don't think the problem is programming problem, because whenever I compile it on my computer which runs Windows, I get the prints from outside the main.

When I compile the project, and run it on the Ubuntu remote server, I don't see any output except the prints from the main, and the warnings raised by methods from outside main class. All methods trying to print and called in the main are declared static.

Maxime Flament
  • 721
  • 1
  • 7
  • 24
  • 1
    I can't see where your `ratePDF` is called in your main-method. – tkausl Aug 20 '16 at 23:54
  • Your `main` still doesn't compile because of syntax problems. It would be great if you show us your _real_ code. – tkausl Aug 20 '16 at 23:57
  • What does the code abbreviated as `[...]` do? Also, do the print statement in `ratePDF` print anything at all? In short, what is the expected output and what do you get? – fge Aug 20 '16 at 23:58
  • @tkausl problem is that I have also PHP called in the `rateElementsDouble(filePDF, listElements)` method. @fge I'm editing so my question will be clearer. – Maxime Flament Aug 21 '16 at 00:01

1 Answers1

0

Solved :

I was compiling Java with the 1.8.0.101 JDK version on Windows, and running it with the 1.8.0.91 on Ubuntu, which (I think) must have created version conflicts..

I solved the issue by updating Java JRE so I had same versions of Java onto Windows and Ubuntu.

Maxime Flament
  • 721
  • 1
  • 7
  • 24