Hi,
First of all I am not a java programmer. what I am doing is just trying to port a precompiled game to other machine.
I have a java game project. the final output or the game is "game.jar". I compiled this in fedora with netbeans (5.5.1) ide. It was running well in fedora.
But The problem arises when I try to run that same jar file from windows with same command. I used same jdk in both linux and windows.
when I run it from fedora
# java -jar game.jar
works ok
but in windows
C:\src\java\Che rryGame\>java -jar game.jar
Exception in thread "AWT-EventQueue-0" java.lang.Numbe rFormatExceptio n: For input string: ""
at java.lang.Numbe rFormatExceptio n.forInputStrin g(NumberFormatE xception.java:4 8)
at java.lang.Integ er.parseInt(Int eger.java:468)
at java.lang.Integ er.parseInt(Int eger.java:497)
at cherrygame.glob al.readConfigFo rStickProtectio n(global.java:2 060)
at cherrygame.nbCh erryGame.<init> (nbCherryGame.j ava:243)
at netbeansapplica tion.nbApplicat ion.<init>(nbAp plication.java: 46)
at netbeansapplica tion.nbApplicat ion$14.run(nbAp plication.java: 453)
at java.awt.event. InvocationEvent .dispatch(Invoc ationEvent.java :209)
at java.awt.EventQ ueue.dispatchEv ent(EventQueue. java:597)
at java.awt.EventD ispatchThread.p umpOneEventForF ilters(EventDis patchThread.jav a:273)
at java.awt.EventD ispatchThread.p umpEventsForFil ter(EventDispat chThread.java:1 83)
at java.awt.EventD ispatchThread.p umpEventsForHie rarchy(EventDis patchThread.jav a:173)
at java.awt.EventD ispatchThread.p umpEvents(Event DispatchThread. java:168)
at java.awt.EventD ispatchThread.p umpEvents(Event DispatchThread. java:160)
at java.awt.EventD ispatchThread.r un(EventDispatc hThread.java:12 1)
I use the same directory structure in both linux and windows. in fact I use the same jar file all the time. the source tree is accessible in both linux and windows.
Can anyone tell me how to make it run successfully?
I am stuck.
3 3764
Hi,
First of all I am not a java programmer. what I am doing is just trying to port a precompiled game to other machine.
I have a java game project. the final output or the game is "game.jar". I compiled this in fedora with netbeans (5.5.1) ide. It was running well in fedora.
But The problem arises when I try to run that same jar file from windows with same command. I used same jdk in both linux and windows.
when I run it from fedora
# java -jar game.jar
works ok
but in windows
C:\src\java\Che rryGame\>java -jar game.jar
Exception in thread "AWT-EventQueue-0" java.lang.Numbe rFormatExceptio n: For input string: ""
at java.lang.Numbe rFormatExceptio n.forInputStrin g(NumberFormatE xception.java:4 8)
at java.lang.Integ er.parseInt(Int eger.java:468)
at java.lang.Integ er.parseInt(Int eger.java:497)
at cherrygame.glob al.readConfigFo rStickProtectio n(global.java:2 060)
at cherrygame.nbCh erryGame.<init> (nbCherryGame.j ava:243)
at netbeansapplica tion.nbApplicat ion.<init>(nbAp plication.java: 46)
at netbeansapplica tion.nbApplicat ion$14.run(nbAp plication.java: 453)
at java.awt.event. InvocationEvent .dispatch(Invoc ationEvent.java :209)
at java.awt.EventQ ueue.dispatchEv ent(EventQueue. java:597)
at java.awt.EventD ispatchThread.p umpOneEventForF ilters(EventDis patchThread.jav a:273)
at java.awt.EventD ispatchThread.p umpEventsForFil ter(EventDispat chThread.java:1 83)
at java.awt.EventD ispatchThread.p umpEventsForHie rarchy(EventDis patchThread.jav a:173)
at java.awt.EventD ispatchThread.p umpEvents(Event DispatchThread. java:168)
at java.awt.EventD ispatchThread.p umpEvents(Event DispatchThread. java:160)
at java.awt.EventD ispatchThread.r un(EventDispatc hThread.java:12 1)
I use the same directory structure in both linux and windows. in fact I use the same jar file all the time. the source tree is accessible in both linux and windows.
Can anyone tell me how to make it run successfully?
I am stuck.
Hi,
Java is a Platform independent Language, moreover Jar contains only class files, and Java itself says that "Write Once Run Any where " so it has to be executed, and moreover you have written this source code and compiled it using the Tool , please cross check whether there are any tool specific xml files are there for configuration, if that is the case you are unable to execute the code.
Cheers,
Sateesh.
JosAH 11,448
Recognized Expert MVP
Exception in thread "AWT-EventQueue-0" java.lang.Numbe rFormatExceptio n: For input string: ""
at java.lang.Numbe rFormatExceptio n.forInputStrin g(NumberFormatE xception.java:4 8)
at java.lang.Integ er.parseInt(Int eger.java:468)
at java.lang.Integ er.parseInt(Int eger.java:497)
at cherrygame.glob al.readConfigFo rStickProtectio n(global.java:2 060)
at cherrygame.nbCh erryGame.<init> (nbCherryGame.j ava:243)
at netbeansapplica tion.nbApplicat ion.<init>(nbAp plication.java: 46)
at netbeansapplica tion.nbApplicat ion$14.run(nbAp plication.java: 453)
at java.awt.event. InvocationEvent .dispatch(Invoc ationEvent.java :209)
at java.awt.EventQ ueue.dispatchEv ent(EventQueue. java:597)
at java.awt.EventD ispatchThread.p umpOneEventForF ilters(EventDis patchThread.jav a:273)
at java.awt.EventD ispatchThread.p umpEventsForFil ter(EventDispat chThread.java:1 83)
at java.awt.EventD ispatchThread.p umpEventsForHie rarchy(EventDis patchThread.jav a:173)
at java.awt.EventD ispatchThread.p umpEvents(Event DispatchThread. java:168)
at java.awt.EventD ispatchThread.p umpEvents(Event DispatchThread. java:160)
at java.awt.EventD ispatchThread.r un(EventDispatc hThread.java:12 1)
From what I see in that stack trace the game is trying to read some configuration
data. Are you sure you packed the correct config data with the .jar? Maybe the
game is reading from other config data when run in fedora.
kind regards,
Jos
Hi,
Java is a Platform independent Language, moreover Jar contains only class files, and Java itself says that "Write Once Run Any where " so it has to be executed, and moreover you have written this source code and compiled it using the Tool , please cross check whether there are any tool specific xml files are there for configuration, if that is the case you are unable to execute the code.
Cheers,
Sateesh.
actually I compiled it with netbeans 5.5.1
netbeans uses ant as backend as far I found in forums. then I compiled it by ant.
#ant -buildfile build.xml
my build file is here, I omitted the comments -
<?xml version="1.0" encoding="UTF-8"?>
-
<project name="NetBeansApplication" default="default" basedir=".">
-
<description>Builds, tests, and runs the project NetBeansApplication.</description>
-
<import file="nbproject/build-impl.xml"/>
-
<target name="-post-jar">
-
<jar update="true" destfile="${dist.jar}">
-
<zipfileset src="${libs.swing-layout.classpath}"/>
-
<zipfileset src="${libs.addMoney.classpath}"/>
-
<zipfileset src="${libs.NormalWindow.classpath}"/>
-
</jar>
-
</target>
-
</project>
-
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Romain |
last post by:
Hello,
I am writing out a binary file. I figured that the number "10" is
automaticaly converted to "OD OA" instead of "OD". "OD" and "OA" are
line feed and carriage return.
I know it does that if the file is opened in something else than in
binary mode. But in my example below, the file is really opened in
binary.
|
by: Jim |
last post by:
Hello,
I'm trying to read .zip files and drop from the listing those files
that are directories. I'm using the zipfile module.
Does anyone know how I can I tell which files in the .zip are
directories? I have looked around the net for the information but I
cannot make it out: the pkzip specification hints that it is in the
"external file attribute" but also hints that it is dependent on the
platform on which the .zip was made (I get...
|
by: Sandra-24 |
last post by:
Comparing file system paths as strings is very brittle. Is there a
better way to test if two paths point to the same file or directory
(and that will work across platforms?)
Thanks,
-Sandra
|
by: darren |
last post by:
Hi
I have an assignment that is in C and, for an API call, asks for a
uint_16 and uint_32 in one of its functions.
In my C++ code i've been using uint16_t and uint32_t for fixed length
integers. Are these two Types compatible?
Also, if i make a struct of a few variables of type uint_xxx_t, can I
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
| |
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |