Cycling 74 » All Postshttps://cycling74.com/forums/forum/java/feed/
Fri, 09 Dec 2016 17:10:53 +0000http://bbpress.org/?v=2.5.3-5249en-UShttps://cycling74.com/forums/topic/mxj-help/#post-369707https://cycling74.com/forums/topic/mxj-help/#post-369707
Fri, 25 Nov 2016 08:38:43 +0000Jan
with max 7 the documentation it’s hidden in the app bundle. but it’s still there.
]]>
https://cycling74.com/forums/topic/mxj-help/#post-369703https://cycling74.com/forums/topic/mxj-help/#post-369703
Fri, 25 Nov 2016 05:59:19 +0000Floating Point
you need to integrate the code with classes that can act as a bridge between the jvm and max. These classes come with the max install. There is also an api that you should check out. This is all explained in the java-specific tutorials. If you have max 6 they’re in a folder called java-doc. there should also be a document called WritingMaxExternalsInJava.pdf that is very useful. if not is should be available somewhere on the c74 website
]]>
https://cycling74.com/forums/topic/mxj-help/#post-369604https://cycling74.com/forums/topic/mxj-help/#post-369604
Wed, 23 Nov 2016 09:13:37 +0000Jon
Hi,

I am building a application that reads data form text files (lots of it) and uses it for a serial composition. After having trouble with the size allocation of both [dict] and [zl] i have chosen to write the text sorting part in java and hopefully run it in an mxj object. The java code is simple and runs well (basically it opens the file, searches for substrings and outputs them to the print window).

I have tried so many different ways to get this running in max. My aim is that when it receives a bang it will open the text file, processes it and spit the substrings out of an outlet.

]]>
https://cycling74.com/forums/topic/jbox2d/#post-368612https://cycling74.com/forums/topic/jbox2d/#post-368612
Tue, 08 Nov 2016 20:46:36 +0000nicolasnuzillard
Finally I found an other solution which is dyn4j, a JAVA 2D library which is younger than box2d. It is very easy to include in mxj compared to jbox2d. It is entierly made in JAVA and seems to a be a good way to have a game engine as a Max patch controller, which was what I wanted to do when I wrote this post.
]]>
https://cycling74.com/forums/topic/jbox2d/#post-368562https://cycling74.com/forums/topic/jbox2d/#post-368562
Tue, 08 Nov 2016 12:36:34 +0000nicolasnuzillard
OK. I could run an mxj external with some jbox2d classes. If anyone is interested I can give the instructions to make it work. If anyone has an other solution to do physics by using some code within max, I would like to know how to do it.
Nicolas.
]]>
https://cycling74.com/forums/topic/jbox2d/#post-368549https://cycling74.com/forums/topic/jbox2d/#post-368549
Tue, 08 Nov 2016 09:20:49 +0000Jan
without knowing the definate answer my guess is you can’t. Max-Java is in maintence mode, meaning not actively developed anymore, since before jit.phys.* appeared….
]]>
https://cycling74.com/forums/topic/jbox2d/#post-368522https://cycling74.com/forums/topic/jbox2d/#post-368522
Mon, 07 Nov 2016 16:42:49 +0000nicolasnuzillard
I could also do something like this (photo), it should work but I’d really like to have everything embeded in the code.

Attachments:

ex1.png

]]>
https://cycling74.com/forums/topic/jbox2d/#post-368502https://cycling74.com/forums/topic/jbox2d/#post-368502
Mon, 07 Nov 2016 13:01:26 +0000nicolasnuzillard
Is it possible to use jit.phys within mxj knowing that there is no dict object to get the results of a
collision ?
]]>
https://cycling74.com/forums/topic/jbox2d/#post-368501https://cycling74.com/forums/topic/jbox2d/#post-368501
Mon, 07 Nov 2016 12:51:51 +0000nicolasnuzillard
I managed to set up eclipse and add the librairies. Now there is a problem with dependancies and the use of maven. Has anyone ever have to deal with this ? I cant include what was made by maven in m’y project. i want to use jbox un ordre to have more control on whats going on. It would be painful to do it by patching. Then i will output a matrix fort the results.
]]>
https://cycling74.com/forums/topic/jbox2d/#post-368500https://cycling74.com/forums/topic/jbox2d/#post-368500
Mon, 07 Nov 2016 12:50:03 +0000Mathieu Chamagne
Hi
never tried jbox2d … but I’ve been using this Max external a lot, and it’s great :http://charles.bascou.free.fr/box2d/

but nowadays, with Max’s jit.phys.* , what would be the advantage of box2d ?…

Has any one ever tried to make the Java library JBox2d work in mxj ? Does it requiers the use of an IDE such as Eclipse (I hate dealing with IDE and libraries).
Has anyone good results or any way to get start with ?

So…I am trying to build a java twitterbot in a max patch. The Twitterbot works in native java and runs happily in the terminal (OSX). It even seems to compile in the mxj object and finds the twitter4j library in the class path (I was very surprise!).

Problem – I’d doesn’t do anything.

When I compile and run this form the terminal it starts up, reads for changes in my twitter feed and prints status updates accordingly (system.out.print).

What do I need to add to this to get an output in max? I not actually sure if this is running or not as there is no feedback or status print.

I have attached the java code. My user info has been xxx’ed out so you will get an error on run, but maybe someone can spot a few noobe errors.

Thanks Muchly!

PS – this is heading in the direction of an oblique strategies bot, with some added 20thC composition goodness. I will publish the full code when working, with some instruction about generating and adding your own twitter credentials.

I would like to access directly OSC data inside my mxj’s, using the com.illposed.osc library, but so far I have been unsuccesful. I think I have been able to format the input correctly, but the mxj fails to open in Max. I get java.lang.ClassNotFoundError for the OSCListener. I am developing in Eclipse, and I have (I think) taken all necessary steps to import the library into my project build path. At least there is no red squiggle under the import statements anywhere in Eclipse. Does anybody have any ideas on where the fish is buried in this code? At the moment I am content simply getting the data (an array of one int and three floats) to simply pass through the object, once that is sorted out I will start actually doing something with it… Any help is much appreciated!

Still new at this and have gotten stuck. I’m trying to work with Twitter4j and modify the already available [mxj]searchtweet into something using streaming tweets. Anyways, the biggest question I have is how to make the 4 system.out.printIn things I have go to the 4 outlets of my mxj object? I realize it has to do with try and catch exceptions but I just cannot get it to work with statusListener.

Any help would be greatly appreciated!!
Thanks all!

Heres the basic java on how to extract streaming tweets from Twitter with Twitter4j.

]]>
https://cycling74.com/forums/topic/tcpip-communication-with-tcpclient/#post-360707https://cycling74.com/forums/topic/tcpip-communication-with-tcpclient/#post-360707
Tue, 28 Jun 2016 14:32:58 +0000Celine Renaud
Hello,
I want to communicate with a plugin by socket string messages in a server. Max have to subscribe and then it recieves messages from the server.
I try tcpClient of arvid but I still have some problems :

To test what was the problem I use SocketTest3. So :
– SocketTest3 as server connected with Max (max recieve and send socket messages)
– SocketTest3 as Client with the plugin of the game (socketTest3 can recieve and send socket messages)
– Max can subscribe ton the plugin but never recieve the messages back.

Thanks for the response. Your article was the one I used to try and set Eclipse up. That part worked fine, thanks to your excellent guidance :-) It seems the problem is not with Ecplipse, but rather in how to add additional paths for Max to locate the mxj. I finally managed to get it to work by placing the project in /users/Max 7/Packages/externals/java-classes. No other places on the harddrive seems to do the trick…

]]>
https://cycling74.com/forums/topic/problems-loading-classes-built-in-eclipse/#post-360296https://cycling74.com/forums/topic/problems-loading-classes-built-in-eclipse/#post-360296
Wed, 22 Jun 2016 21:15:43 +0000nick rothwell / cassiel
I did a short write-up many years ago, here:

I’m just starting to add Java to my Max skillset, but I am bumping into what should be a quick fix, but apparently isn’t…
I prefer to write my externals in Eclipse, but I can’t get them to load as externals unless I paste the code into mxj quickie and save it from there. Even then Max can’t load the classes after restarting. I changed the relevant lines in /Application Support/Cycling’74/java/max.java.config.txt to

; add all jars in /Users/topher/myjars to the dynamic classpath of MXJClassLoader ;
max.dynamic.jar.dir /Users/kennethflak/Documents/workspace

but to no avail. I have also tried placing the .java and .class files in all the official places, including the same folder as the max patch, but it will still not load unless I go through the previously mentioned quickie treatment. Anybody know what is going on here?

Can someone describe step by step how to use Processing in mxj. which files do I have to move and which IDE the best to make things the most simple as possible.
As a final goal I’d like to make a UI that uses physics (buttons are affected by physics).