Program run in Netbeans but NOT running as jar file

Dear all ,
i hope any help in this problem.
i am writing program to access parallel port i put next files :
1. [ comm.jar + javax.comm.properties ] in
[ C:\Program Files\Java\jdk1.6.0_18\lib ] and [ C:\Program Files\Java\jdk1.6.0_18\jre\lib ]
2. [ win32com.dll ] in [ C:\WINDOWS\system32 ]
when i run application in NetBeans IDE 6.8 work fine and every think is ok
BUT when i produce jar file , generated jar file does not work [GUI appear but can not get ports on PC]
- I try to set Environment Variable as next :
CLASSPATH = .;C:\Program Files\Java\jdk1.6.0_18\lib\comm.jar
also does not work
any tip please ?
Thanks in advance
Nabil

First of all, leave the lib and jre/lib directories of the JRE alone. Never ever touch them again. Remove any jars you have put there yourself, or better yet completely remove and reinstall the JRE to make sure you put it back in a correct state.
After you do that, learn how to properly work with the classpath in both the IDE and the command line.
Netbeans: you define the classpath by adding jars to the project (right click on the libraries node in the project tree to get the appropriate options).
Command line: this depends on if you run a single class, or you invoke an executable jar.
Single class: you use the -cp command line switch to define the classpath
Executable jar: the jar itself defines the classpath in its META-INF/manifest.mf file. The -cp command line switch is ignored.
Since you use Netbeans, you'll get an executable jar so make sure to learn how such a jar is structured.

Similar Messages

  • Application working under NetBeans but not as a *.jar file

    Hello,
    recently I found a little problem. I wrote application that shows all available ports in my computer. When I am running this applications under NetBeans it works with no problem - finds all available ports. Then I am building it to the *.jar file. Application is working with no problem but command:
    Enumeration PortIds = CommPortIdentifier.getPortIdentifiers();
    is not returning any identifiers - PortIds is empty.
    Anyone knows a solution for this type of problems? Thanks

    Hi Venkatesh,
    Few questions.
    1. What is your JDeveloper version? (Always better to post your JDev version along with the question, which would help us to help you better).
    2. Did you try adding webserviceclient.jar to the classpath? (Search in your JDev installation directory for the location of this jar file).
    -Arun

  • TS1717 What do I have to do to keep the iTUNES program on my computer BUT NOT RUNNING on Start UP? It requires too much CPU usage on my old computer.

    What do I have to do to keep the iTUNES loaded as a program on my computer BUT NOT RUNNING on Start UP? Just opening when I want to use it.
    It requires too much CPU usage on my old computer.

    You can check you Adobe account online to see if the serial number is registered under your account.  If not then your only option will likely be to contact Adobe Support directly thru chat to see if they can provide you with a/the serial number. For them to do so will require you being able to prove ownership.
    Serial number and activation chat support (non-CC)
    http://helpx.adobe.com/x-productkb/global/service1.html ( http://adobe.ly/1aYjbSC )

  • The application runs from netbeans, but not the command-line

    Hi
    I have developed a GUI application using NetBeans. All source code files are compiling without problems and the program runs just fine when i press "run <app name>" in NetBeans. However, when i try to execute the jar file using the command "java -jar <name of jar>", then i get this error message (im standing in the same directory as the jar file which is the dist directory:
    $ java -jar /home/icebyte/NetBeansProjects/TripPlanner/dist/TripPlanner.jar
    Exception in thread "main" java.lang.NoClassDefFoundError: tripplanner/Main
    Caused by: java.lang.ClassNotFoundException: tripplanner.Main
    at java.net.URLClassLoader$1.run(URLClassLoader.java:221)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:209)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:324)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:269)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:337)
    Error: Could not find the main class.
    Error: A JNI error has occurred, please check your installation and try again
    Does someone know why i am getting this error ? I would be nice to find out. I have also tried to go into the src directory of the netbeans project and compile all files there which works fine, but when i try to run the program with "java <file that contains main method>" i get this error:
    Exception in thread "main" java.lang.NoClassDefFoundError: MainMenu (wrong name: tripplanner/MainMenu)
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:638)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:143)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:281)
    at java.net.URLClassLoader.access$000(URLClassLoader.java:74)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:216)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:209)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:324)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:269)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:337)
    Error: Could not find the main class.
    Error: A JNI error has occurred, please check your installation and try again
    I have JDK and JRE installed on the system (it came with netbeans). I have tried setting the JAVA_HOME variable, but there is no difference. Anyone? Thanks for all help.

    Hmm, i solved the problem now. I looked at this problem yesterday and couldnt find out why i was getting these stack traces, but now i know :)

  • Access of MySQlL Driver class by eclipse but not from Outside Jar file

    Dear All,
    I have done a standalone application having access with MySQl database.
    I could access it when i execute it from eclipse. But when i export it into Jar file and running I get MySQL Driver class not found exception.
    Give me a better solution for this issue.

    CLASSPATH, CLASSPATH, CLASSPATH.
    You have defined the Eclipses Project Library Path to include the MySQL jar, but ar not including it on the classpath when executing the jar.
    Either modify the MANIFEST.mf file in the jar to include a reference to the MySQL driver jarfile or call java in the following manner
    java -cp /full/path/to/MySQL/Driver/jarfile.jar -jar yourJarFile.jarObviously, if this is on Windows and you are executing through a double click, the first option is the best option.

  • Application works in jdeveloper but not as standalone jar file

    Hi All
    We have developed an application using BI Publisher APIs,it works as expected through JDevelper,however when I try to deploy it to a jar file a run it through command line it gives me No class found exception for
    javax/xml/rpc/Service class factory.. thinking that the class is not present.I have extracted the jar file but could find the class file in the expected directory........anyhelp would greatly be appreciated.
    Regards
    Venkatesh

    Hi Venkatesh,
    Few questions.
    1. What is your JDeveloper version? (Always better to post your JDev version along with the question, which would help us to help you better).
    2. Did you try adding webserviceclient.jar to the classpath? (Search in your JDev installation directory for the location of this jar file).
    -Arun

  • I was running Foxfire 3.6.9 and wanted to use FTP Program add-on and it did not appear to load but appeared but then would be installed but not run or appear under tools. So I deleted Foxfire 3.6.9 and down loaded to 3.5.9 so it could get FTP and it is do

    I was running Foxfire 3.6.9 and wanted to use FTP Program add-on and it did not appear to load but appeared but then would be installed but not run or appear under tools. So I deleted Foxfire 3.6.9 and down loaded to 3.5.9 so it could get FTP and it is doing the same could not install. Even after I registered my copy. The last time I used this program it showed up under tools and worked great. any suggestions on whats going on and how I can get around this?.by ralphd3g

    Delete the files extensions.* (extensions.rdf, extensions.cache, extensions.ini) and compatibility.ini in the Firefox [[Profiles|profile folder]] to reset the extensions registry.
    See "Corrupt extension files": http://kb.mozillazine.org/Unable_to_install_themes_or_extensions
    If you see disabled extensions that are not compatible on the next start in "Tools > Add-ons > Extensions" then click the "Find Updates" button to do a compatibility check.

  • Compile correct but not run java programs

    I have problem. Java program copile correctly but not run. I can't understand this one.
    **this is the error**
    Exception in thread "main" java.lang.NoClassDefFoundError: suminda
    Caused by: java.lang.ClassNotFoundException: suminda
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClassInternal(Unknown Source)
    Could not find the main class: suminda. Program will exit.

    The error is telling you that the jvm could not find a class named suminda. Are you aware that class names are case sensitive? Suminda is not the same as suminda for example.
    This error usually happens when you haven't specified the classpath correctly. A simple thing to try isjava -cp  .  sumindaHere's some links that may help.
    [http://www.kevinboone.com/classpath.html]
    [http://java.sun.com/javase/6/docs/technotes/tools/findingclasses.html]

  • JavaService - can install java program into win2k service, but cannot run

    i have a JavaService problem: i can install java program into win2k service, but cannot run
    the version of javaservice is 2.0.7.0
    the following is the message:
    C:\DailyUpdate\dist>JavaService.exe -install DailyUpdate C:\Program Files\Java\j
    dk1.5.0_05\jre\bin\client\jvm.dll -Djava.class.path=C:\DailyUpdate\dist\ftpbean.
    jar;C:\DailyUpdate\dist\mysql-connector-java-3.0.10-stable-bin.jar;C:\DailyUpdat
    e\dist\DailyUpdater.jar -Xms16M -Xmx64M -start DailyUpdateHandler -params C:\Dai
    lyUpdate\dist -out C:\DailyUpdate\dist\logs\out.log -err C:\DailyUpdate\dist\lo
    gs\err.log
    The DailyUpdate automatic service was successfully installed
    The DailyUpdate service is starting.
    The DailyUpdate service could not be started.
    The service did not report an error.
    More help is available by typing NET HELPMSG 3534.

    I might be doing some programming for my company soon
    which will require a program to monitor a database
    and whenever there is a change to certain fields, it
    must copy certain fields into another database. When I see "whenever thiere is a change to certain fields" I tend to think "triggers" - but maybe this won't work for you 'cause of the "another database" part. And the fact that triggers are inherently evil.
    [snip]
    Is it possible to run a Java program as a windows
    service? And if so then how would you go about it? I'd hit Google - there're a couple ways to do this.
    [snip]
    Also,...if I were to use one of those programs which
    can make an .exe of a Java program, then do you still
    require the JRE to be on the machine? It depends on how you did the conversion. If you compile to native then no, if you just wrap up a JRE then yes.
    Why I ask is
    that I occasionally get asked to do small development
    projects for my company, but we are a microsoft
    partner and therefore do all the development in C#
    and the like. So I would like to just implement as
    many things in Java as I can, just to show everyone
    that Java can do exactly what C# can do. But its
    difficult to convince people of this since I always
    require the JRE and they dont. Of course, they require the .NET framework and you don't. And last I looked that thing was around 23 Meg.

  • DAC Task are queued but not running

    Hi Everybody,
    Currently we are running the ETL for only Financials and there are 394 tasks in total out of which 285 have been completed successfully. At times some of the tasks would just get stuck on particular action. For e.g The analyze task after dimension population would remain in the queued status and would never switch to run mode. So we had to abort the ETL and restart it. This action resulted in successful completion of the previously queued task. Now for past two days the ETL is once again stuck (queued but not running).
    For e.g The following task is showing status of running
    51     SIL_InventoryProductDimension_SCDUpdate     Running     2009-03-02 21:09:59.0                    DataWarehouse     DataWarehouse     SILOS          Update Slowly Changing Dimension     Informatica     0     0     -2     CUST R11 5 10
    But if I right click on the details
    I get this
    1     SIL_InventoryProductDimension_SCDUpdate_Full     Running     2009-03-02 17:40:41.0     2009-03-02 21:09:09.0     3 hour(s), 28 min(s), 28 sec(s)     Verifying if workflow still running on Informatica Server 'Oracle_BI_DW_Server'.
    If still running will attach to the workflow.     DataWarehouse     Informatica     0          -2     0
    And the remaining detail tasks for this are in queued status.
    What could be the reason?
    Does it need the Infomartica workflow manager open? It is open currently open but must have been accidently closed in between.
    Informatica services have always been running.
    Thank you very much
    Nilesh
    [excel dashboard|http://www.exceldashboard.org]
    dashboard Software
    [Access Dashboard|http://www.accessdashboards.com]
    [Dashboard Reporting|http://www.reportingdashboard.com]
    Edited by: njethwa on Jan 6, 2010 5:39 PM

    Hi
    This Sometime happens with DAC.We faced the same issue and had an SR open with Siebel for almost 2 weeks,they Couldnt help us out.
    Restart your DAC Server and Do a Dryrun and then run your full ETL .
    The Analyze task would not hang anymore.
    I dot have any logical reason why this happens,but i am guessing it has to do with some java heap memory.So restarting the Server would free up the memory.(i am guessing but not sure).
    But it Works.
    Try it
    Let me know if this helps
    Thanks
    H

  • Constant Error; Adobe Flash Player 11.4 r402 has stopped working. But NOT running Trusteer Rapport.

    I am experiancing this unbelieveably annoying and constant Flash error;  Adobe Flash Player 11.4 r402 has stopped working.
    But NOT running Trusteer Rapport, I never have, and it's not even installed on my computer.  So what's causing this?

    There were a couple AntiVirus/AntiMalware products that keep coming up, but I haven't validated that in the lab and don't want to call anyone out publicly without reporting the issue to them first.

If you could tell me what antivirus/antimalware products and versions you have installed, that would be helpful.
    So, third party stuff aside, I'd like to know more about the crashes your seeing:
    1.) Please provide links to the Firefox crash reports.  If you have multiples, the first few would be great.
         In Firefox, type about:crashes in the address bar
         If the link starts with "bp...", it's already been submitted -- just right-click on it and copy the link, and paste it into the reply here.
         If not, click it to submit it, and copy the subsequent link.
    2.) In firefox, type about:support
         Just copy and paste the output into the reply.
    3.) In Firefox, type about:plugins
         Please copy and paste the output into the reply
    4.) Please provide the output of the DirectX Diagnostic Utility
         Click Start > type "dxdiag" [enter]
         Click Save All Information
         Copy the output of the file into the reply, or use Adobe SendNow/DropBox/PasteBin to share the file.
    5.) If you can provide an exact URL and step-by-step instructions on repeating the crash (if it's consistent), that would be really helpful.  My goal is to build out a configuration that matches yours as closely as possible, reproduce the problem and then debug it.
    If you're not comfortable sharing that diagnostic information publicly, send me a private message.  Just click my name and use the options on the right.
    Thanks!

  • How to programmatically load and show the front panel of a vi but NOT run it?

    Is there a way to load and show the front panel of a vi but NOT run it?  I am starting with the AsynchronousCallAndForget.vi from the example finder and inserted an invoke node with the FP Open method call prior to the Start Asynchronous Call node. The vi I am loading has the "Run when opened" unchecked and the menu bar IS visible so I can manually click the run arrow. Thanks!
    Solved!
    Go to Solution.

    Why are you using the Async call? If you simply open the VI reference, then call the FP.Open method this works fine. You can then call the VI run method with Wait Until Done set to false if you wish to run it Asynchronously, this is how we did it in ye olde days before we had this new fangled "Start Asynchronous Call" stuff. 
    Charles Chickering
    Architecture is art with rules.
    ...and the rules are more like guidelines

  • Please I can not get a .jar file to run on XP SP3 start/run/cmd/

    I can not get a .jar file to run on XP SP3 start/run/cmd/
    Please help if can figure this out. I'm convinced it is a Windows XP SP3 problem from searching on google and seeing other ppl on XP SP3 with same problem (but no working solution for myself). I'll try to be complete-listing all I've done.
    I had installed: Java SE Runtime Environment v6u14 for Windows Multi-language
    I had checked here it was working properly: http://www.java.com/en/download/manual.jsp
    I'm trying to run this jar file (soht-client-0.6.2.jar):
    http://prdownloads.sourceforge.net/telnetoverhttp/soht-java-client-0.6.2.zip?download
    http://www.ericdaugherty.com/dev/soht/javaclient.html < this is the information for the program.
    (yes the file can be executed and should open the program's window
    I wanted to post screenshot of it but friend that it's working for isn't here)
    _(Please find log of all cmds I did in this post here: http://pastebin.com/f792983df )_
    _I have extracted +'all' the files to: C:\062\+_ (I have tried using other directories, same problem)
    ++I then start/open/run/cmd+
    then I: cd C:\062\+
    then I try various commands - all+ of these do absolutely nothing- meaning no errors, no reply, no window opens, nothing except enters that directoy again:
    java -jar soht-client-0.6.2.jar
    java -jar -client soht-client-0.6.2.jar
    java -client -jar soht-client-0.6.2.jar
    java -jar soht-client-0.6.2.jar soht.properties
    soht-client-0.6.2.jar
    So I try this cmd: java soht-client-0.6.2.jar
    Reply:
    C:\062>java soht-client-0.6.2.jar
    Exception in thread "main" java.lang.NoClassDefFoundError: soht-client-0/6/2/jar
    Caused by: java.lang.ClassNotFoundException: soht-client-0.6.2.jar
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClassInternal(Unknown Source)
    Could not find the main class: soht-client-0.6.2.jar. Program will exit.
    I try this cmd:
    java -jar soht-client-0.6.2.jar -client
    Reply:
    C:\062>java -jar soht-client-0.6.2.jar -client
    Unable to load configuration file: -client - java.io.FileNotFoundException: -cli
    ent (The system cannot find the file specified)
    SOHT Java Client
    The SOHT Java Client requires a properties file. Either start
    the application in the same directory as the soht.properties
    file, or specify the file name on the command line:
    java -jar soht-cleint-<version>.jar c:\soht.properties
    So then I do these cmds which produce the exact same error/reply just above; Unable to load..:
    j_ava -jar soht-client-0.6.2.jar -client soht.properties_
    java -jar soht-client-0.6.2.jar -client C:\062\soht.properties
    So then I copy soht.properties to C root and do:
    java -jar soht-client-0.6.2.jar -client C:\soht.properties <same error as above
    Then from other information I have read I right click on the .jar file, select open with Always open with:
    _"C:\Program Files\Java\jre6\bin\javaw.exe"_
    Try again.. same problem.
    Then I do cmd:
    _"C:\Program Files\Java\jre6\bin\javaw.exe" -jar "C:\062\soht-client-0.6.2.jar"_
    does nothing, retry the other commands same thing (either nothing or those same replies)
    Then I read (http://forums.sun.com/thread.jspa?threadID=5384879) someone had the same problem as I and they solved it by uninstalling all Java/reboot/ then install JDK 6 Update 14 with NetBeans 6.5.1 start NetBeans and then it worked for them.
    So I unistalled all Java, rebooted and gave the cmd another try (before re-installing), now a new error, of course:
    C:\062>java -jar soht-client-0.6.2.jar
    'java' is not recognized as an internal or external command, operable program or batch file.
    Then I install  Java SE and NetBeans Cobundle (JDK 6u14 and NB 6.5.1) Final Release/ reboot/ open Netbeans/
    go to test java page; all is good, run cmds again -and still nothing..
    C:\062>java -version
    java version "1.6.0_14"
    Java(TM) SE Runtime Environment (build 1.6.0_14-b08)
    Java HotSpot(TM) Client VM (build 14.0-b16, mixed mode, sharing)
    I reassociate program with: C:\Program Files\Java\jre1.6.007\bin\javaw.exe_
    same thing.. nothing
    Thank you very much for your time :D_
    PS. My computer has been newly reformatted so needing another reformat I'm sure is not the solution.

    Thank you very much for your replies Taggert_77 & swmtgoet_x :D
    Taggert77_: I have never used NetBeans. I only installed it in the bundle as I had read on another post that somehow installing the bundle magically helped another user with the same problem (he didn't know why it worked after that either).
    Before XP SP3 I was able to execute .jar file through cmd prompt. Now I am not.
    This file is executable, grab it and you will see. Here is a screen shot (program in front is FlashFXP, behind is the cmd prompt and what should happen):http://www.freeimagehosting.net/uploads/53273b4ddf.jpg
    swmtgoetx_: I only did the other cmd's to try to make it spit out something, anything lol :D
    The proper cmd is simply: java -jar soht-client-0.6.2.jar
    I did give your cmd a try, and it produced nothing :( (just like the other correct cmds)
    java -client -jar soht-client-0.6.2.jar soht.properties
    Thank you again...the mystery remains
    PS. If you do a search for this you'll find an amazing amount of XP SP3 users with the same problem and no solution posted that I could find except one chap that did the unistall install order that I did above).

  • I think a firewall is interfering with my mail program - I can receive but not send. Please help!

    I think Firefox may have installed a firewall that is interfering with my email program - I can receive but not send mail.
    == This happened ==
    Not sure how often
    == Firefox updated with ALOT

    Firefox does not install a firewall.

  • TS1389 Trying to play purchased TV series to my Apple TV, I am requested to authorise the computer.  This has already been done and I have tried the suggestions regarding authorisation.  I can play the programs on my computer, but not the Apple TV.

    Trying to play purchased TV series to my Apple TV, I am requested to authorise the computer.  This has already been done and I have tried the suggestions regarding authorisation.  I can play the programs on my computer, but not the Apple TV.
    Any ideas?

    in remote app click on the
    lower left corner on the text
    top of the context menu click devices
    choose the appletv rather then your shared lib in the list
    if you are trying to view a movie that is located on your ipad on your tv using the appletv then
    you should use airplay mirror not the remote app

Maybe you are looking for

  • Problem on creating spatial index

    Hi, I am newbie in Oracle Spatial and looking for help on creating spatial index I am working on OpenStreetMap data. I intended to import the OSM data from PostGis to Oracle Spatial. This code is executed to import the data ogr2ogr -f OCI OCI:osm/pas

  • Problem when creating 8i database on RH6.0

    my machine is oracle 8i on REdhat 6.0 and when I use script to create database it is said some views ,some tables and synonym do not exist then drop them Will the database work well in future?

  • Do I need to reboot host machine when Restarting an Administration Server ?

    Please let me know if you have come across following situation. I have two separate physical machine (Sun Solaris) having separate Weblogic 8.1 server running. One machine is prodcution server and another contigency server. In the contigency situatio

  • HT3819 Home Sharing issue

    I have enabled home sharing on both my computers but still cannot see either library on either unit.  Could this be an OS issue?  One has Win 7 and the other has Win 8.  No homegroups have been used and I can see each machine on the opposing network.

  • Opens folders and files without double-clicking

    I have a MB Air. I can't click normally files or folders in Bridge without it opening them. With folders it's pretty ok, but with images that I wanna preview before editing, it's a pain. I have managed to go around it with two-finger click that puts