Showing posts with label Java. Show all posts
Showing posts with label Java. Show all posts

Tuesday, May 18, 2010

Fix matlab gui in linux

This term I had to do some work on matlab so I installed the linux version but I found something very irritating in the guide gui builder , the gui wasnt stable at all and every time I move a button or any control all the window flickers like this …

at first I thought compiz was the reason for this but it turns out that disabling compiz has no great effect.
after a lot of searching I found that the reason of the problem was Java !! … matlab didnt find the jre location therefore couldn't render the gui well,
so a the executing this simple command in your terminal solves the problem

export MATLAB_JAVA=/usr/lib/jvm/java-6-sun/jre/

note : you have to replace the path on the previous command with the correct path of the jre

Tuesday, September 30, 2008

Compile and Execute Java Files using a bat file

I started to learn java and I needed a fast way to compile and execute small java programs that I wrote on notepad or my favorite Notepad++ and command prompt is considered a very fast way if you know that you Don't have to rewrite the command each time you want to compile or run a java file , you can just write them in a .bat file and execute all this commands with a double click.

All what you have to do is to write the commands in a text file and save it with .bat file extension.

An example of .bat file that compiles and execute a java file in my desktop :

@echo off

rem delete the old class file to avoid executing it
rem if there was an error in the new java file
cd C:\Documents and Settings\Ahmed Kotb\Desktop\
if exist a.class del a.class

rem Compile the java file(s)
cd C:\Program Files\Java\jdk1.6.0_04\bin\
javac "C:\Documents and Settings\Ahmed Kotb\Desktop\a.java"

rem Execute
cd C:\Documents and Settings\Ahmed Kotb\Desktop\
if exist a.class java a

pause

any comments or questions are welcomed
Hope this was useful.

5 years of kotbcorp

Two days ago this blog completed its 5th year  :). So congratulations to my self and Thanks for the few followers that have been here for ...