Find the answer to your Linux question:
Results 1 to 8 of 8
hi all, i have developed a desktop application using java swings in NetBeans IDE in windows. It is working fine here. But when I run the jar in Linux, it ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Oct 2008
    Posts
    6

    Question cudnt execute jar file in linux which is developed in windows


    hi all,
    i have developed a desktop application using java swings in NetBeans IDE in windows. It is working fine here. But when I run the jar in Linux, it is not working.
    Null Peer!? Exception is occuring and a blank form is displaying.

    Please enlighten me on what's going on and possible workarounds.

    Thanks in adv!

  2. #2
    Linux Engineer Thrillhouse's Avatar
    Join Date
    Jun 2006
    Location
    Arlington, VA, USA
    Posts
    1,377
    Can you post the full exception stack trace and which version of Java you're running on the Windows and Linux machines?

  3. #3
    Just Joined!
    Join Date
    Oct 2008
    Posts
    6
    Here is the version of java. I have developed it in NetBeans6...
    java version "1.4.2"
    gij (GNU libgcj) version 4.1.1 20061011 (Red Hat 4.1.1-30)

    Copyright 2006 Free Software Foundation, Inc.
    This is free software; see the source for copying conditions. There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

    And i have used NetBeans6.0.1. I hvnt used any other libs also.

    pls suggest me a solution!

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Engineer Thrillhouse's Avatar
    Join Date
    Jun 2006
    Location
    Arlington, VA, USA
    Posts
    1,377
    Well, for one thing you're not using an official Sun JDK; you're using an open-source equivalent. I would bet that on your Windows machine you're using the official JDK. I would recommend installing Sun's JDK and trying again.

    But without the stack trace and maybe the section of code that is throwing the exception, it's hard to help.

  6. #5
    Just Joined!
    Join Date
    Oct 2008
    Posts
    6

    Exclamation

    thanks for your suggestions!

    i have installed jdk1.6 on my linux os. It is working fine, but iam getting gtk2.0 unsupported. ignoring
    and
    clearlooks not supported errors!

    pls tell me why im getting this errors and possible workarounds.

  7. #6
    Linux Engineer Thrillhouse's Avatar
    Join Date
    Jun 2006
    Location
    Arlington, VA, USA
    Posts
    1,377
    Again, without the code it's hard to be of much help. However, my guess is that your system is probably missing some development libraries that are required to display some of the things the code is trying to do. For the GTK error, I would look for a package named gtk+2.0-devel or gtk-dev or something like that and install it. The Clearlooks error is probably rooted in the GTK error since Clearlooks is just a theme engine for GTK+ but I can't be sure of that. The fix may require something else to be done.

  8. #7
    Just Joined!
    Join Date
    Oct 2008
    Posts
    6

    Lightbulb

    sorry for that!
    im not getting any error here. thats y i cudnt give you any error message. im not even getting the errorstack which i have given in my program.

    i have used the following code to set the look and feel of my app to work in all platforms (cross-platform).

    UIManager.setLookAndFeel(UIManager.getCrossPlatfor mLookAndFeelClassName());

  9. #8
    Linux Engineer Thrillhouse's Avatar
    Join Date
    Jun 2006
    Location
    Arlington, VA, USA
    Posts
    1,377
    Quote Originally Posted by sourceCoder View Post
    i have used the following code to set the look and feel of my app to work in all platforms (cross-platform).

    UIManager.setLookAndFeel(UIManager.getCrossPlatfor mLookAndFeelClassName());
    I have a hard time believing you're getting gtk errors from that line of code since the "cross-platform" look and feel is Java's own LAF that comes with Swing (and is not associated with any GUI toolkit) and gtk errors would be considered very platform dependent. You would probably get "gtk unsupported" errors if you were using getSystemLookAndFeelClassName().

    The only other advice I can offer is to look at your swing.properties file for anything that looks suspicious or out of place.

Posting Permissions

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