getting started with Max Java
Hello,
I've discovered the classes folder in c74 > java and wonder I can find some patches with these?
Thank you
Hi Kyred,
Those are located in c74 > java > help
Good luck,
FRid
OK. Quickie just does like ".java" in the filename.
But now I get
Compiling /Applications/Max6/Cycling '74/java/classes/javasimplegridshape.java.........
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/javac -classpath /Applications/Max6/Cycling '74/java/lib/ej.jar:/Applications/Max6/Cycling '74/java/lib/jitter.jar:/Applications/Max6/Cycling '74/java/lib/jode-1.1.2-pre-embedded.jar:/Applications/Max6/Cycling '74/java/lib/max.jar:/Applications/Max6/Cycling '74/java/classes/ /Applications/Max6/Cycling '74/java/classes/javasimplegridshape.java
/Applications/Max6/Cycling '74/java/classes/javasimplegridshape.java[ 9 ] expected
mycircle = new JitterObject("jit.gl.gridshape",new Atom[]{Atom.newAtom("cosm")});
^
/Applications/Max6/Cycling '74/java/classes/javasimplegridshape.java[ 11 ] expected
mycircle.setAttr("lighting_enable",1);
^
/Applications/Max6/Cycling '74/java/classes/javasimplegridshape.java[ 11 ] illegal start of type
mycircle.setAttr("lighting_enable",1);
^
/Applications/Max6/Cycling '74/java/classes/javasimplegridshape.java[ 11 ] illegal start of type
mycircle.setAttr("lighting_enable",1);
^
/Applications/Max6/Cycling '74/java/classes/javasimplegridshape.java[ 12 ] expected
mycircle.setAttr("smooth_shading",1);
^
/Applications/Max6/Cycling '74/java/classes/javasimplegridshape.java[ 12 ] illegal start of type
mycircle.setAttr("smooth_shading",1);
^
/Applications/Max6/Cycling '74/java/classes/javasimplegridshape.java[ 12 ] illegal start of type
mycircle.setAttr("smooth_shading",1);
^
7 errors
[ 15 févr. 2012 18:37:55 ]
compilation of /Applications/Max6/Cycling '74/java/classes/javasimplegridshape.java failed.
Okay, better like this and welcome to Java
import com.cycling74.max.*;
import com.cycling74.jitter.*;
public class javasimplegridshape extends MaxObject
{
JitterObject mycircle;
public javasimplegridshape(Atom[] args)
{
mycircle = new JitterObject("jit.gl.gridshape",new Atom[]{Atom.newAtom("cosm")});
// mycircle.setAttr("shape", "circle");
mycircle.setAttr("lighting_enable",1);
mycircle.setAttr("smooth_shading",1);
}
}
Since i'm also a java-noob i will/(mostly can) not go into detail about what you did wrong. This is too avoid the possibility to confuse you more. I did however add some comments though and if you just copy this layout you should be allright.
HTH,
FRid
Many thanks for these adds and comment, it really helps and the connexions with java theory come in my head.
:-)
You're welcome and i'd love to help you with the other post too but i haven't yet played around with gl/jitter in java but i'm sure someone else will chime in.
import com.cycling74.max.*;
could you please explain the line above in detail??
udo
There is a actually a quite good documentation how to write java code for max. Search for WritingMaxExternalsInJava.pdf in the installation folder. It says:
/* import the supporting classes from the max.jar API so you
can refer to them without the full package justification. */
import com.cycling74.max.*;