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.

Comsol Java API

Please login with a confirmed email address before reporting spam

Hi,

Anybody knows if comsol Javs API models (like BeamModel.java) are runnable by NetBeans/Ecilipse in Linux(ubunto)? I tried and i got some errors. I still couldnt figure it out how to fix it. Any help will be greatly appreciated. Thanks in advance.

Regards, Mohammad


8 Replies Last Post Feb 7, 2018, 3:42 p.m. EST
Nicholas Goldring Certified Consultant

Please login with a confirmed email address before reporting spam

Posted: 6 years ago Dec 6, 2017, 1:59 p.m. EST

I believe they are executable using eclipse/ubuntu. What errors did you get? And did you import the .jars and add the necessary lines of code?

-------------------
Nick
I believe they are executable using eclipse/ubuntu. What errors did you get? And did you import the .jars and add the necessary lines of code?

Please login with a confirmed email address before reporting spam

Posted: 6 years ago Dec 6, 2017, 3:14 p.m. EST

yes, I import the .jars. The Java Application Project is compiled in windows 10 and works fine but when i run it in Linux (Ubunto) it doesn't run. I tried to figure it out how i can fix it. The last error i got is as follows:

run: /home/m/.cache/netbeans/8.1/executor-snippets/run.xml:53: Java returned: 1 BUILD FAILED (total time: 1 second)

Any helps greatly appriciated.

Regards, Mohammad

yes, I import the .jars. The Java Application Project is compiled in windows 10 and works fine but when i run it in Linux (Ubunto) it doesn't run. I tried to figure it out how i can fix it. The last error i got is as follows: run: /home/m/.cache/netbeans/8.1/executor-snippets/run.xml:53: Java returned: 1 BUILD FAILED (total time: 1 second) Any helps greatly appriciated. Regards, Mohammad

Nicholas Goldring Certified Consultant

Please login with a confirmed email address before reporting spam

Posted: 6 years ago Dec 7, 2017, 2:58 p.m. EST

I'm sorry, it was a long time ago that I used a Java IDE on Linux to run a Comsol model. Other people have had similar issues if you check the forums; it would also be worthwhile to ask support about the problem. Good luck.

-------------------
Nick
I'm sorry, it was a long time ago that I used a Java IDE on Linux to run a Comsol model. Other people have had similar issues if you check the forums; it would also be worthwhile to ask support about the problem. Good luck.

Please login with a confirmed email address before reporting spam

Posted: 6 years ago Jan 25, 2018, 5:48 a.m. EST

hey Nick,

I still havent found any solutions for this issue. can you give me some details of how you could run a comsol model by netbeans/eclipse in linux?

hey Nick, I still havent found any solutions for this issue. can you give me some details of how you could run a comsol model by netbeans/eclipse in linux?

Please login with a confirmed email address before reporting spam

Posted: 6 years ago Feb 7, 2018, 8:00 a.m. EST

Hi,

Here is my java application project attached to this message. It works fine in windows 10 but not in Linux. Link of the jar files are as follows:

https://www.dropbox.com/s/be5oit0gpvipijy/miglayout-4.0-swing.jar?dl=0

https://www.dropbox.com/s/rnpip8fmdghi4w6/plugins.rar?dl=0

You just need to import the above jar files and it runs in windows 10. Can you check it in Linux to see if it works for you?

Hi, Here is my java application project attached to this message. It works fine in windows 10 but not in Linux. Link of the jar files are as follows: https://www.dropbox.com/s/be5oit0gpvipijy/miglayout-4.0-swing.jar?dl=0 https://www.dropbox.com/s/rnpip8fmdghi4w6/plugins.rar?dl=0 You just need to import the above jar files and it runs in windows 10. Can you check it in Linux to see if it works for you?


Walter Frei COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 6 years ago Feb 7, 2018, 8:38 a.m. EST

Hello All,

Regarding the Java API: If anyone is currently using the Java API, we do encourage you to take a thorough look at using Model Methods instead.

Model Methods, as well as Application Methods, have (we believe) almost completely obviated the need for using the API and compiling. Model Methods can be written on the Windows platform, and can be run on any supported platform.

For a quick introduction, see: https://www.comsol.com/blogs/how-to-use-model-methods-to-accelerate-your-comsol-workflow/ https://www.comsol.com/blogs/how-to-create-a-randomized-geometry-using-model-methods/ as well as the Application Programming Guide document.

Best Regards,

Hello All, Regarding the Java API: If anyone is currently using the Java API, we do encourage you to take a thorough look at using Model Methods instead. Model Methods, as well as Application Methods, have (we believe) almost completely obviated the need for using the API and compiling. Model Methods can be written on the Windows platform, and can be run on any supported platform. For a quick introduction, see: https://www.comsol.com/blogs/how-to-use-model-methods-to-accelerate-your-comsol-workflow/ https://www.comsol.com/blogs/how-to-create-a-randomized-geometry-using-model-methods/ as well as the Application Programming Guide document. Best Regards,

Nicholas Goldring Certified Consultant

Please login with a confirmed email address before reporting spam

Posted: 6 years ago Feb 7, 2018, 12:56 p.m. EST

Hey guys,

I apologize for not being able to provide more information on running models through Eclipse on Linux - although this process is outlined in the COMSOL Java API reference guide. Are you able to execute code with your current Eclipse/Linux setup?

Also, like Walter pointed out, model/application methods are really nice for implementing your own pieces of code into your simulations. For instance, I sometimes use a model method to produce a different random number each time I run a simulation - a feature which doesn't seem to be available otherwise, at least in the particular physics interfaces that I'm using now.

-------------------
Nick
Hey guys, I apologize for not being able to provide more information on running models through Eclipse on Linux - although this process is outlined in the COMSOL Java API reference guide. Are you able to execute code with your current Eclipse/Linux setup? Also, like Walter pointed out, model/application methods are really nice for implementing your own pieces of code into your simulations. For instance, I sometimes use a model method to produce a different random number each time I run a simulation - a feature which doesn't seem to be available otherwise, at least in the particular physics interfaces that I'm using now.

Please login with a confirmed email address before reporting spam

Posted: 6 years ago Feb 7, 2018, 3:42 p.m. EST
Updated: 6 years ago Feb 7, 2018, 3:46 p.m. EST

Hi,

I'm not able to execute the code with Eclipse/Linux but it works fine in windows 10. Do you have any version of Linux (Debian or Ubunto) installed in your pc or laptop? If yes, would you please check if it works in your Eclipse/ Linux?

Hi, I'm not able to execute the code with Eclipse/Linux but it works fine in windows 10. Do you have any version of Linux (Debian or Ubunto) installed in your pc or laptop? If yes, would you please check if it works in your Eclipse/ Linux?

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.