Java LCD control?

LK/ELK/VK/PK/OK/MX/GLK/EGLK/GVK/GLT Series

Moderators: Henry, Mods

Post Reply
SiGmA_X
LCD Geek
Posts: 33
Joined: Fri Jul 05, 2002 6:00 pm
Location: Portland, OR, USA
Contact:

Java LCD control?

Post by SiGmA_X »

I saw the Java sample on the MO download page, and I would like to know how to install javax.comm :) I am just getting in to Java (Taking High School & College classes :)) and so it would be really cool to learn to write my own app for my LCD in Java...

So, how do I install the javax.comm librarys? (Could someone give me a decent guide, because the readme is too sparse for someone who has never used a custom lib..)

Thank you :)
Lian Li PC-70
Matrix Orbital LCD2041-WB-V

PatO
LCD Geek
Posts: 27
Joined: Fri Sep 14, 2001 6:00 pm
Contact:

Post by PatO »

Piece of cake.
javax.comm is an optional package for J2SE (Standard Edition) from sun. You need to download it... Do a search on their site for a list of various optional packages. Although, I think it's included in the Enterprise Edition, but don't quote me.

Or, just click this link for the download page.
http://java.sun.com/products/javacomm/

Then, just copy the code from the java example, paste into a file named LCDControl.java, and run as you normally would.

SiGmA_X
LCD Geek
Posts: 33
Joined: Fri Jul 05, 2002 6:00 pm
Location: Portland, OR, USA
Contact:

Post by SiGmA_X »

Okay, I just downloaded it, and attempted to install it...

I still can't get it to import the file.. I cleared my CLASSPATH when I installed (I used command prompt, and messed up the command :-\) so maybe I'm missing something that is needed...

BTW, I'm on AIM/ICQ/MSN/Y! right now, so message me there if you can :)
Lian Li PC-70
Matrix Orbital LCD2041-WB-V

PatO
LCD Geek
Posts: 27
Joined: Fri Sep 14, 2001 6:00 pm
Contact:

Post by PatO »

Ya, well no wonder it doesn't work....
Re-install java and the add-on.
If your classpath is correct, javax.comm should automatically be imported when it sees the include statement. I don't have the java sdk on this machine, so I can't tell you off hand what the classpath should be. A re-install should fix that for you.
Since javax.comm is built into java (and added to your classpath), you shouldn't need to use the "classpath" parameter on your javac or java commands.

Then, compile your class like so: javc LCDControl.java
and run it like so: java LCDControl params...

(sorry, I don't use AIM/ICQ/MSN/Y!)

SiGmA_X
LCD Geek
Posts: 33
Joined: Fri Jul 05, 2002 6:00 pm
Location: Portland, OR, USA
Contact:

Post by SiGmA_X »

Okay, I'll go get the latest Java :)
Lian Li PC-70
Matrix Orbital LCD2041-WB-V

Henry
OMNIPRESENT
OMNIPRESENT
Posts: 3014
Joined: Tue Aug 14, 2001 6:00 pm
Contact:

Post by Henry »

good luck :)
Henry J.
President
Matrix Orbital

SiGmA_X
LCD Geek
Posts: 33
Joined: Fri Jul 05, 2002 6:00 pm
Location: Portland, OR, USA
Contact:

Post by SiGmA_X »

I re-installed Java, and it worked fine. But I couldn't get the javax.comm.* to work, still...

Could you please send me your CLASSPATH that pertains to Java?

Thankx.
Lian Li PC-70
Matrix Orbital LCD2041-WB-V

PatO
LCD Geek
Posts: 27
Joined: Fri Sep 14, 2001 6:00 pm
Contact:

Post by PatO »

Okay, I apologize for being so abrupt before - it turned out to be more difficult than I thought! I'm running Win2k - different versions of Windows tend to handle classpaths differently, namely, Micro$oft has been more thorough at disabling classpaths in newer versions of Windows!
When I registered the comm.jar in the CLASSPATH variable, it didn't take. I had to add it to the command. Like so (run in the same folder as your compiled BlackBox.class:
java -classpath BlackBox.jar;c:\java\lib\comm.jar BlackBox

That is assuming, of course, that you've copied javax.comm.properties, win32com.dll, and comm.jar to their respective folders and have jse(sdk) installed properly.

There is an even slicker way to add files to a classpath, however. On the fly in Batch Files! This way, you can run multiple versions of java and specify different classpaths for different programs, and even keep the classpath down to the darn Windows limitations. This is done like so (place in a file called something like runme.bat):

Code: Select all

@ECHO OFF
set THEPATH=%CLASSPATH%;BlackBox.jar;c:\java\lib\comm.jar
java -classpath %THEPATH% %1
Then, run it like so: runme BlackBox

Presto!
If this doesn't work, let me know what version of Windows you're running and what the error is (cut and paste).

Good luck!

ee06u125
LCD?
Posts: 1
Joined: Sun Mar 16, 2008 7:05 pm

Post by ee06u125 »

hi,
where is this java code?
I've got javax.comm and a load of other libraries installed and wrote my own class but cant seem to get anything displayed on the lcd. I know the lcd is working because its fine with lcd smartie. I just need to look at some example code to see what im doing wrong.
thanks.

*btw its for a project, ive made an rss reader in java incl. gui and i want to send selected info to the lcd, using java.

Ray
Matrix Orbital
Matrix Orbital
Posts: 745
Joined: Thu Dec 13, 2001 4:00 pm
Location: Earth.... I think..
Contact:

Post by Ray »

The Java code moved around quite a bit, its current location is here, good luck with your project!

Post Reply