Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 24

Thread: How can i make java program executable?

  1. #11
    Join Date
    Oct 2004
    Beans
    267

    Re: How can i make java program executable?

    I think the reason why it only works in the Terminal, is because the files /etc/profile and $HOME/.profile (or $HOME/.bash_profile) are only read when you run the Terminal. It's a strange 'feature' (I'd call it a bug) of Debian and Ubuntu.

    Assuming you are using GNOME, try adding the PATH definitions to your JDK to the file .gnomerc in your home directory. It is the same format at .bashrc/.profile/and gang. Log out and log in again. That should make your shell script work from inside GNOME without the need for opening a terminal.
    A life devoted to things is a dead life, a stump; a God-shaped life is a flourishing tree -- Proverbs 11:28 (MSG)

  2. #12
    Join Date
    Nov 2004
    Beans
    2,614

    Re: How can i make java program executable?

    Quote Originally Posted by Viro
    I think the reason why it only works in the Terminal, is because the files /etc/profile and $HOME/.profile (or $HOME/.bash_profile) are only read when you run the Terminal. It's a strange 'feature' (I'd call it a bug) of Debian and Ubuntu.
    No, they're not. They ought to be persisted into the X environment, at least they are for KDM. If GDM got broken again...

    If that script is exactly as written, what does ~/.xsession-errors say when you try to run it? What does this application do?

  3. #13
    Join Date
    Oct 2004
    Beans
    267

    Re: How can i make java program executable?

    Well, they weren't for GNOME for a long time, and I remember on the Debian mailing lists about a year ago where the developers just recommended adding the definitions to .gnomerc while they sorted things out. Haven't heard of them sorting this out, and IIRC I added my definitions to /etc/profile and nothing happened, so I'm guessing things haven't changed .
    A life devoted to things is a dead life, a stump; a God-shaped life is a flourishing tree -- Proverbs 11:28 (MSG)

  4. #14
    Join Date
    Feb 2005
    Location
    Sydney, Australia
    Beans
    375
    Distro
    Ubuntu 7.04 Feisty Fawn

    Re: How can i make java program executable?

    If you make a launcher on the panel or the desktop or whatever, there's an option to 'run in terminal'. That should allow you to still have a launcher, it'll just open up a terminal as well to run the program.
    www.bsodcomic.com
    "Because life looks better in .jpg"

  5. #15
    Join Date
    Jan 2005
    Beans
    346

    Re: How can i make java program executable?

    i think the file you're looking for is /etc/gdm/gdm.conf ... have a look in there for the path, add /home/you/bin at the end and try that.

  6. #16
    Join Date
    Sep 2005
    Location
    US
    Beans
    19
    Distro
    Dapper Drake Testing/

    Re: How can i make java program executable?

    System > Preferances > File Management

    Under Behavior, make sure "Run executable text files when they are clicked" is selected.

    Also check to make sure the file extension is the proper one for that format (I should have qouted so I'd remember if you said or not), and that its associated correctly in nautilus...

    Just a guess, but hope it helps..

  7. #17
    Join Date
    Jan 2006
    Beans
    38

    Re: How can i make java program executable?

    Quote Originally Posted by drummer
    If you make a launcher on the panel or the desktop or whatever, there's an option to 'run in terminal'. That should allow you to still have a launcher, it'll just open up a terminal as well to run the program.
    I have already tried that one mate, it opens up a terminal but disappears after one second and still no program is running.

  8. #18
    Join Date
    Jan 2006
    Beans
    38

    Re: How can i make java program executable?

    Quote Originally Posted by Cashel
    System > Preferances > File Management

    Under Behavior, make sure "Run executable text files when they are clicked" is selected.

    Also check to make sure the file extension is the proper one for that format (I should have qouted so I'd remember if you said or not), and that its associated correctly in nautilus...

    Just a guess, but hope it helps..
    Nothing is happening when i double clicked it.

  9. #19
    Join Date
    Jan 2006
    Beans
    38

    Re: How can i make java program executable?

    Quote Originally Posted by LordHunter317
    No, they're not. They ought to be persisted into the X environment, at least they are for KDM. If GDM got broken again...

    If that script is exactly as written, what does ~/.xsession-errors say when you try to run it? What does this application do?
    Ok, this is what i have on my ~/.xsession-errors when i tried to run my simple test program "Hello World" inside the JOptionPane.showMessageDialog(). I have highlighted the part where i think errors that generated by java.

    /
    Code:
    etc/gdm/PreSession/Default: Registering your session with wtmp and utmp
    /etc/gdm/PreSession/Default: running: /usr/bin/X11/sessreg -a -w /var/log/wtmp -u /var/run/utmp -x "/var/lib/gdm/:0.Xservers" -h "" -l ":0" "ariel"
    /etc/gdm/Xsession: Beginning session setup...
    _IceTransTransNoListen: unable to find transport: tcp
    _IceTransmkdir: ERROR: euid != 0,directory /dev/X will not be created.
    _IceTransmkdir: ERROR: Cannot create /dev/X
    _IceTransPTSOpenServer: mkdir(/dev/X) failed, errno = 13
    _IceTransOpen: transport open failed for pts/MyUbuntu:
    _IceTransMakeAllCOTSServerListeners: failed to open listener for pts
    _IceTransISCOpenServer: Protocol is not supported by a ISC connection
    _IceTransOpen: transport open failed for isc/MyUbuntu:
    _IceTransMakeAllCOTSServerListeners: failed to open listener for isc
    _IceTransSCOOpenServer: Protocol is not supported by a SCO connection
    _IceTransOpen: transport open failed for sco/MyUbuntu:
    _IceTransMakeAllCOTSServerListeners: failed to open listener for sco
    SESSION_MANAGER=unix/MyUbuntu:/tmp/.ICE-unix/8714
    
    ** (gnome-session:8714): WARNING **: Host name lookup failure on localhost.
    Gnome-Message: gnome_execute_async_with_env_fds: returning -1
    Gnome-Message: gnome_execute_async_with_env_fds: returning -1
    manager.c/562: setting[0]: bool: autobrowse = 1
    manager.c/562: setting[1]: bool: autoburn = 1
    manager.c/557: setting[2]: string: autoburn_audio_cd_command = serpentine
    manager.c/557: setting[3]: string: autoburn_photo_cd_command = nautilus --no-desktop burn:
    manager.c/557: setting[4]: string: autoburn_data_cd_command = nautilus --no-desktop burn:
    manager.c/562: setting[5]: bool: autoipod = 0
    manager.c/557: setting[6]: string: autoipod_command = 
    manager.c/562: setting[7]: bool: automount_drives = 1
    manager.c/562: setting[8]: bool: automount_media = 1
    manager.c/562: setting[9]: bool: autophoto = 1
    manager.c/557: setting[10]: string: autophoto_command = gnome-volume-manager-gthumb %h
    manager.c/562: setting[11]: bool: autoplay_cda = 1
    manager.c/557: setting[12]: string: autoplay_cda_command = sound-juicer -d %d
    manager.c/562: setting[13]: bool: autoplay_dvd = 1
    manager.c/557: setting[14]: string: autoplay_dvd_command = totem %d
    manager.c/562: setting[15]: bool: autoplay_vcd = 1
    manager.c/557: setting[16]: string: autoplay_vcd_command = totem %d
    manager.c/562: setting[17]: bool: autoprinter = 0
    manager.c/557: setting[18]: string: autoprinter_command = gnome-cups-add hal://%h
    manager.c/562: setting[19]: bool: autorun = 0
    manager.c/557: setting[20]: string: autorun_path = .autorun:autorun:autorun.sh
    manager.c/557: setting[21]: string: eject_command = /usr/bin/eject
    manager.c/2082: mount_all: mounting /dev/hdd
    manager.c/1258: mounting /org/freedesktop/Hal/devices/volume_label_...
    manager.c/696: executing command: /usr/bin/pmount-hal /org/freedesktop/Hal/devices/volume_label_
    Warning: device /dev/hdd is already handled by /etc/fstab, supplied label is ignored
    mount: block device /dev/hdd is write-protected, mounting read-only
    manager.c/1878: Mounted: /org/freedesktop/Hal/devices/volume_label_
    
    ** (gnome-cups-icon:8831): WARNING **: IPP request failed with status 1030
    
    ** (gnome-cups-icon:8831): WARNING **: IPP request failed with status 1030
    
    ** (gnome-cups-icon:8831): WARNING **: IPP request failed with status 1030
    
    ** (gnome-cups-icon:8831): WARNING **: IPP request failed with status 1030
    
    ** (gnome-cups-icon:8831): WARNING **: IPP request failed with status 1030
    
    ** (gnome-cups-icon:8831): WARNING **: IPP request failed with status 1030
    
    ** (gnome-cups-icon:8831): WARNING **: IPP request failed with status 1030
    
    ** (gnome-cups-icon:8831): WARNING **: IPP request failed with status 1030
    
    ** (gnome-cups-icon:8831): WARNING **: IPP request failed with status 1030
    
    ** (gnome-cups-icon:8831): WARNING **: IPP request failed with status 1030
    
    ** (gnome-cups-icon:8831): WARNING **: IPP request failed with status 1030
    
    ** (gnome-cups-icon:8831): WARNING **: IPP request failed with status 1030
    
    ** (gnome-cups-icon:8831): WARNING **: IPP request failed with status 1030
    
    ** (gnome-cups-icon:8831): WARNING **: IPP request failed with status 1030
    
    ** (gnome-cups-icon:8831): WARNING **: IPP request failed with status 1030
    
    ** (gnome-cups-icon:8831): WARNING **: IPP request failed with status 1030
    
    ** (gnome-cups-icon:8831): WARNING **: IPP request failed with status 1030
    
    ** (gnome-cups-icon:8831): WARNING **: IPP request failed with status 1030
    
    ** (gnome-cups-icon:8831): WARNING **: IPP request failed with status 1030
    
    ** (gnome-cups-icon:8831): WARNING **: IPP request failed with status 1030
    
    ** (gnome-cups-icon:8831): WARNING **: IPP request failed with status 1030
    
    ** (gnome-cups-icon:8831): WARNING **: IPP request failed with status 1030
    
    ** (gnome-cups-icon:8831): WARNING **: IPP request failed with status 1030
    
    ** (gnome-cups-icon:8831): WARNING **: IPP request failed with status 1030
    
    ** (gnome-cups-icon:8831): WARNING **: IPP request failed with status 1030
    
    ** (gnome-cups-icon:8831): WARNING **: IPP request failed with status 1030
    
    ** (gnome-cups-icon:8831): WARNING **: IPP request failed with status 1030
    
    ** (gnome-cups-icon:8831): WARNING **: IPP request failed with status 1030
    
    ** (gnome-cups-icon:8831): WARNING **: IPP request failed with status 1030
    
    ** (gnome-cups-icon:8831): WARNING **: IPP request failed with status 1030
    
    ** (gnome-cups-icon:8831): WARNING **: IPP request failed with status 1030
    
    ** (gnome-cups-icon:8831): WARNING **: IPP request failed with status 1030
    
    ** (gnome-cups-icon:8831): WARNING **: IPP request failed with status 1030
    
    ** (gnome-cups-icon:8831): WARNING **: IPP request failed with status 1030
    
    ** (gnome-cups-icon:8831): WARNING **: IPP request failed with status 1030
    
    ** (gnome-cups-icon:8831): WARNING **: IPP request failed with status 1030
    
    ** (gnome-cups-icon:8831): WARNING **: IPP request failed with status 1030
    
    ** (gnome-cups-icon:8831): WARNING **: IPP request failed with status 1030
    
    ** (gnome-cups-icon:8831): WARNING **: IPP request failed with status 1030
    
    ** (gnome-cups-icon:8831): WARNING **: IPP request failed with status 1030
    
    ** (gnome-cups-icon:8831): WARNING **: IPP request failed with status 1030
    
    ** (gnome-cups-icon:8831): WARNING **: IPP request failed with status 1030
    
    ** (gnome-cups-icon:8831): WARNING **: IPP request failed with status 1030
    
    ** (gnome-cups-icon:8831): WARNING **: IPP request failed with status 1030
    
    ** (gnome-cups-icon:8831): WARNING **: IPP request failed with status 1030
    
    ** (gnome-cups-icon:8831): WARNING **: IPP request failed with status 1030
    
    ** (gnome-cups-icon:8831): WARNING **: IPP request failed with status 1030
    
    ** (gnome-cups-icon:8831): WARNING **: IPP request failed with status 1030
    
    ** (gnome-cups-icon:8831): WARNING **: IPP request failed with status 1030
    
    ** (gnome-cups-icon:8831): WARNING **: IPP request failed with status 1030
    
    ** (gnome-cups-icon:8831): WARNING **: IPP request failed with status 1030
    
    ** (gnome-cups-icon:8831): WARNING **: IPP request failed with status 1030
    
    ** (gnome-cups-icon:8831): WARNING **: IPP request failed with status 1030
    
    ** (gnome-cups-icon:8831): WARNING **: IPP request failed with status 1030
    
    ** (gnome-cups-icon:8831): WARNING **: IPP request failed with status 1030
    
    ** (gnome-cups-icon:8831): WARNING **: IPP request failed with status 1030
    
    ** (gnome-cups-icon:8831): WARNING **: IPP request failed with status 1030
    
    ** (gnome-cups-icon:8831): WARNING **: IPP request failed with status 1030
    
    ** (gnome-cups-icon:8831): WARNING **: IPP request failed with status 1030
    
    ** (gnome-cups-icon:8831): WARNING **: IPP request failed with status 1030
    
    ** (gnome-cups-icon:8831): WARNING **: IPP request failed with status 1030
    
    ** (gnome-cups-icon:8831): WARNING **: IPP request failed with status 1030
    
    ** (gnome-cups-icon:8831): WARNING **: IPP request failed with status 1030
    
    ** (gnome-cups-icon:8831): WARNING **: IPP request failed with status 1030
    
    ** (gnome-cups-icon:8831): WARNING **: IPP request failed with status 1030
    
    ** (gnome-cups-icon:8831): WARNING **: IPP request failed with status 1030
    
    ** (gnome-cups-icon:8831): WARNING **: IPP request failed with status 1030
    
    ** (gnome-cups-icon:8831): WARNING **: IPP request failed with status 1030
    
    ** (gnome-cups-icon:8831): WARNING **: IPP request failed with status 1030
    
    ** (gnome-cups-icon:8831): WARNING **: IPP request failed with status 1030
    
    ** (gnome-cups-icon:8831): WARNING **: IPP request failed with status 1030
    
    ** (gnome-cups-icon:8831): WARNING **: IPP request failed with status 1030
    
    ** (gnome-cups-icon:8831): WARNING **: IPP request failed with status 1030
    
    ** (gnome-cups-icon:8831): WARNING **: IPP request failed with status 1030
    
    ** (gnome-cups-icon:8831): WARNING **: IPP request failed with status 1030
    
    ** (gnome-cups-icon:8831): WARNING **: IPP request failed with status 1030
    Exception in thread "main" java.awt.AWTError: Cannot load AWT toolkit: gnu.java.awt.peer.gtk.GtkToolkit
       at java.awt.Toolkit.getDefaultToolkit() (/usr/lib/libgcj.so.6.0.0)
       at java.awt.Font.tk() (/usr/lib/libgcj.so.6.0.0)
       at java.awt.Font.getPeerFromToolkit(java.lang.String, java.util.Map) (/usr/lib/libgcj.so.6.0.0)
       at java.awt.Font.Font(java.lang.String, int, int) (/usr/lib/libgcj.so.6.0.0)
       at javax.swing.plaf.FontUIResource.FontUIResource(java.lang.String, int, int) (/usr/lib/libgcj.so.6.0.0)
       at javax.swing.plaf.metal.DefaultMetalTheme.<clinit>() (/usr/lib/libgcj.so.6.0.0)
       at java.lang.Class.initializeClass() (/usr/lib/libgcj.so.6.0.0)
       at javax.swing.plaf.metal.MetalLookAndFeel.createDefaultTheme() (/usr/lib/libgcj.so.6.0.0)
       at javax.swing.plaf.metal.MetalLookAndFeel.MetalLookAndFeel() (/usr/lib/libgcj.so.6.0.0)
       at javax.swing.UIManager.<clinit>() (/usr/lib/libgcj.so.6.0.0)
       at java.lang.Class.initializeClass() (/usr/lib/libgcj.so.6.0.0)
       at javax.swing.UIManager.getUI(javax.swing.JComponent) (/usr/lib/libgcj.so.6.0.0)
       at javax.swing.JOptionPane.updateUI() (/usr/lib/libgcj.so.6.0.0)
       at javax.swing.JOptionPane.JOptionPane(java.lang.Object, int, int, javax.swing.Icon, java.lang.Object[], java.lang.Object) (/usr/lib/libgcj.so.6.0.0)
       at javax.swing.JOptionPane.JOptionPane(java.lang.Object, int) (/usr/lib/libgcj.so.6.0.0)
       at javax.swing.JOptionPane.showMessageDialog(java.awt.Component, java.lang.Object) (/usr/lib/libgcj.so.6.0.0)
       at Hello2.main(java.lang.String[]) (Unknown Source)
       at gnu.java.lang.MainThread.call_main() (/usr/lib/libgcj.so.6.0.0)
       at gnu.java.lang.MainThread.run() (/usr/lib/libgcj.so.6.0.0)
    Caused by: java.lang.ClassNotFoundException: gnu.java.awt.peer.gtk.GtkToolkit not found in gnu.gcj.runtime.SystemClassLoader{urls=[file:/home/ariel/Hello2.jar,file:./], parent=gnu.gcj.runtime.ExtensionClassLoader{urls=[], parent=null}}
       at java.net.URLClassLoader.findClass(java.lang.String) (/usr/lib/libgcj.so.6.0.0)
       at java.lang.ClassLoader.loadClass(java.lang.String, boolean) (/usr/lib/libgcj.so.6.0.0)
       at java.lang.ClassLoader.loadClass(java.lang.String) (/usr/lib/libgcj.so.6.0.0)
       at java.lang.Class.forName(java.lang.String, boolean, java.lang.ClassLoader) (/usr/lib/libgcj.so.6.0.0)
       at java.lang.Class.forName(java.lang.String) (/usr/lib/libgcj.so.6.0.0)
       at java.awt.Toolkit.getDefaultToolkit() (/usr/lib/libgcj.so.6.0.0)
       ...18 more
    
    ** (gnome-cups-icon:8831): WARNING **: IPP request failed with status 1030
    
    ** (gnome-cups-icon:8831): WARNING **: IPP request failed with status 1030
    Do you think there is something missing with the installation of my java?
    This is how i setup java on my system (this might help):
    * I downloaded the jdk1.5.0_06 from the Sun's website.
    * Created directory for my java called /java on /usr and
    that's where i installed it.
    * Then i added export PATH=/usr/java/jdk1.5.0_06/bin/:$PATH to my ~/.bashrc to set its classpath.

    Cheers mate...
    Last edited by Packard Dell; February 4th, 2006 at 08:03 AM.

  10. #20
    Join Date
    Jan 2006
    Beans
    38

    Re: How can i make java program executable?

    Quote Originally Posted by Viro
    I think the reason why it only works in the Terminal, is because the files /etc/profile and $HOME/.profile (or $HOME/.bash_profile) are only read when you run the Terminal. It's a strange 'feature' (I'd call it a bug) of Debian and Ubuntu.

    Assuming you are using GNOME, try adding the PATH definitions to your JDK to the file .gnomerc in your home directory. It is the same format at .bashrc/.profile/and gang. Log out and log in again. That should make your shell script work from inside GNOME without the need for opening a terminal.
    Couldn't find .gnomerc in my home directory. Thanks.

Page 2 of 3 FirstFirst 123 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •