Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.

How to pass command line options to the java compile through "comsol compile"

Please login with a confirmed email address before reporting spam

Hello, My problem is that my system JDK (on linux) is more recent than what comsol accepts. As far as I remember the java compile can be instructed to produce class files with older versions (using the -target option?). My question is, how can one pass this option to the java compile through the 'comsol compile' script? comsol compile -jdkroot /path/to/jdk ???? my_file.java Thank you Daniel


1 Reply Last Post 2019年6月5日 GMT-4 11:45

Please login with a confirmed email address before reporting spam

Posted: 5 years ago 2019年6月5日 GMT-4 11:45

Hi Daniel,

I struggled with this a lot, until I moved to Eclipse : if you more or less follow the instructions to set up Eclipse given in the first few pages of the API reference manual, Eclipse will be able to compile for you, and will indeed do so automatically each time you save a java file (at least if "automatically build" is ticked).

Now, I might be wrong but I suspect that if you create one User library per version of comsol you have, the compilation version will be that of the jar files you loaded in your Eclipse project ...

Hi Daniel, I struggled with this a lot, until I moved to Eclipse : if you more or less follow the instructions to set up Eclipse given in the first few pages of the API reference manual, Eclipse will be able to compile for you, and will indeed do so automatically each time you save a java file (at least if "automatically build" is ticked). Now, I might be wrong but I suspect that if you create one **User library** per version of comsol you have, the compilation version will be that of the jar files you loaded in your Eclipse project ...

Note that while COMSOL employees may participate in the discussion forum, COMSOL® software users who are on-subscription should submit their questions via the Support Center for a more comprehensive response from the Technical Support team.