[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.platform.swt] Re: problems running HelloWorld.

An update to my problem.

I finally got it working. The reason it wouldn't work from ant was because I wasn't forking the vm and passing it jvmarg instead of arg.

Veronika Irvine wrote:
swt-pi-gtk-2133 is the non-platform specific way of referencing the
library - it maps to libswt-pi-gtk-2133.so on linux.

-Djava.library.path=/home/jwickard/eclipse/plugins/org.eclipse.swt.gtk_2.1.1
/os/linux/x86 is the correct way to reference it.

One possibility is that the permissions for the library are incorrect - make
sure the library can be accessed by the userid running the build.xml.

I have never tried this from ant so I am not sure if you are passing the VM
arg in correctly.   You could add a line to your Java class to print out the
value of the "java.library.path" property to be sure it is getting passed in
correctly:

System.out.println(System.getProperty("java.library.path"));


"destr0" <jwickard@xxxxxxxxxxxxxxxx> wrote in message news:3EC25BD2.6030800@xxxxxxxxxxxxxxxxxxx

I am having troubles running a HelloWorld example on linux.  I'm not
running the program as an eclipse build, but as an ant build.

I get the following error when I try to run the program:

[java] java.lang.UnsatisfiedLinkError: no swt-pi-gtk-2133 in
java.library.path


I am using a java.library.path argument for building the file:

-Djava.library.path=/home/jwickard/eclipse/plugins/org.eclipse.swt.gtk_2.1

.1/os/linux/x86

this is where libswt-pi-gtk-2133.so resides.. there is no:
swt-pi-gtk-2133.so

Is there a problem with the naming, or is there something else in this
process that I"m missing?

attached is the contents of the build file I'm using:

build.xml:

<?xml version="1.0" encoding="UTF-8"?>

<project basedir="." default="all" name="Tester">

<!-- target init sets up the "variable" declarations for use later in
the build file. -->
    <target name="init">
        <property name="build.dir" value="./build" />
        <property name="src.dir" value="./src" />
        <property name="swt.lib"
value="/home/jwickard/eclipse/plugins/org.eclipse.swt.gtk_2.1.1/ws/gtk" />
        <property name="native.widget.path"


value="/home/jwickard/eclipse/plugins/org.eclipse.swt.gtk_2.1.1/os/linux/x86 "

/>

        <!-- Setup the classpath definition for building the project -->
       <path id="classpath">
            <fileset dir="${swt.lib}">
                <include name="**/*.jar"/>
            </fileset>
            <pathelement location="${build.dir}"/>
        </path>
    </target>

    <target depends="init" name="compile">
        <javac debug="true" deprecation="true" destdir="${build.dir}"
srcdir="${src.dir}">
            <classpath refid="classpath"/>
        </javac>
    </target>

    <target depends="init,compile" name="exe">
     <java classname="HelloWorld">
         <arg value="-Djava.library.path=${native.widget.path}" />
         <classpath refid="classpath" />
       </java>
       </target>


<target depends="init,compile" description="builds all" name="all" />

</project>