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.

Simple Java Programme does not compile in V50

Please login with a confirmed email address before reporting spam

Hallo,

the very simple java programme below works in version 4.4 of Comsol but not with version 5.0.
There are no error messages, but the class-file is not generated.
I run (on Linux):

comsol compile test.java

Did anybody run into the same problem and found a solution?

Thanks in advance.


Regards

Jens

-------------------------------------------------------------------------
import java.io.*;
import com.comsol.model.*;
import com.comsol.model.util.*;

public class test{

public static void main(String[] args) throws Exception {
run();
}

public static Model run() throws Exception{
Model model = ModelUtil.create("Model");
model.param().set("Laenge","4.6[m]");
return model;
}
};

2 Replies Last Post 2015年3月25日 GMT-4 03:18
Gunnar Andersson COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 10 years ago 2015年3月24日 GMT-4 11:36
I run (on Linux):

comsol compile test.java


Because of a bug introduced in 5.0, you have to provide the absolute path to the file. E.g., something like

comsol compile /home/jensk/test.java

This bug will be fixed in the upcoming 5.1 release.


[QUOTE]I run (on Linux): comsol compile test.java[/QUOTE] Because of a bug introduced in 5.0, you have to provide the absolute path to the file. E.g., something like comsol compile /home/jensk/test.java This bug will be fixed in the upcoming 5.1 release.

Please login with a confirmed email address before reporting spam

Posted: 10 years ago 2015年3月25日 GMT-4 03:18
Thanks Gunnar, that does the trick.

I hope another problem is also contained in the upcoming fix:
Unfortunately my colleagues introduce space in directory names. In that case the path will not be treated correctly. E.g
comsol compile "/home/jens/Project 42/test.java"
will complain about no existing "/home/jens/Project".

But I can work around by placing java files in a non-space place.

Regards

Jens
Thanks Gunnar, that does the trick. I hope another problem is also contained in the upcoming fix: Unfortunately my colleagues introduce space in directory names. In that case the path will not be treated correctly. E.g comsol compile "/home/jens/Project 42/test.java" will complain about no existing "/home/jens/Project". But I can work around by placing java files in a non-space place. Regards Jens

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.