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 7 févr. 2018, 15:42 UTC−5
Nicholas Goldring Certified Consultant

Please login with a confirmed email address before reporting spam

Posted: 7 years ago 6 déc. 2017, 13:59 UTC−5

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: 7 years ago 6 déc. 2017, 15:14 UTC−5

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: 7 years ago 7 déc. 2017, 14:58 UTC−5

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: 7 years ago 25 janv. 2018, 05:48 UTC−5

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: 7 years ago 7 févr. 2018, 08:00 UTC−5

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: 7 years ago 7 févr. 2018, 08:38 UTC−5

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: 7 years ago 7 févr. 2018, 12:56 UTC−5

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: 7 years ago 7 févr. 2018, 15:42 UTC−5
Updated: 7 years ago 7 févr. 2018, 15:46 UTC−5

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.