LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-10-2010, 07:51 PM   #1
Zirbert
LQ Newbie
 
Registered: Oct 2010
Distribution: Ubuntu Studio
Posts: 13

Rep: Reputation: 0
Starting Games from Command Line - Launcher Option?


Hi,

I'm addicted to Forge, the Magic: The Gathering client. To start it, I currently open a terminal window and type these two commands:

cd /media/sda5/Forge
java -jar run-forge.jar

Can I create a Launcher that I can just click on to start the game instead of this? If not, is there a one-line way to do this? I've tried just entering this line in Terminal:

java -jar /media/sda5/Forge/run-forge.jar

However, that gives me this error:

java.io.FileNotFoundException: forge.properties (No such file or directory)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:137)
at treeProperties.TreeProperties.<init>(TreeProperties.java:158)
at treeProperties.TreeProperties.<init>(TreeProperties.java:132)
at forge.properties.ForgeProps.<clinit>(ForgeProps.java:28)
at forge.Gui_NewGame.<clinit>(Gui_NewGame.java:108)
Exception in thread "main" java.lang.ExceptionInInitializerError
at forge.Gui_NewGame.<clinit>(Gui_NewGame.java:108)
Caused by: java.lang.NullPointerException
at java.util.regex.Matcher.getTextLength(Matcher.java:1151)
at java.util.regex.Matcher.reset(Matcher.java:308)
at java.util.regex.Matcher.<init>(Matcher.java:228)
at java.util.regex.Pattern.matcher(Pattern.java:905)
at java.util.Formatter.parse(Formatter.java:2474)
at java.util.Formatter.format(Formatter.java:2430)
at java.io.PrintWriter.format(PrintWriter.java:878)
at java.io.PrintWriter.printf(PrintWriter.java:777)
at forge.error.ErrorViewer.printError(ErrorViewer.java:134)
at forge.error.ErrorViewer.showError(ErrorViewer.java:72)
at forge.error.ErrorViewer.showError(ErrorViewer.java:53)
at forge.properties.ForgeProps.<clinit>(ForgeProps.java:31)
... 1 more
Could not find the main class: forge.Gui_NewGame. Program will exit.
rod@levi:~$ java -jar /media/sda5/Forge/run-forge.jar
java.io.FileNotFoundException: forge.properties (No such file or directory)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:137)
at treeProperties.TreeProperties.<init>(TreeProperties.java:158)
at treeProperties.TreeProperties.<init>(TreeProperties.java:132)
at forge.properties.ForgeProps.<clinit>(ForgeProps.java:28)
at forge.Gui_NewGame.<clinit>(Gui_NewGame.java:108)
Exception in thread "main" java.lang.ExceptionInInitializerError
at forge.Gui_NewGame.<clinit>(Gui_NewGame.java:108)
Caused by: java.lang.NullPointerException
at java.util.regex.Matcher.getTextLength(Matcher.java:1151)
at java.util.regex.Matcher.reset(Matcher.java:308)
at java.util.regex.Matcher.<init>(Matcher.java:228)
at java.util.regex.Pattern.matcher(Pattern.java:905)
at java.util.Formatter.parse(Formatter.java:2474)
at java.util.Formatter.format(Formatter.java:2430)
at java.io.PrintWriter.format(PrintWriter.java:878)
at java.io.PrintWriter.printf(PrintWriter.java:777)
at forge.error.ErrorViewer.printError(ErrorViewer.java:134)
at forge.error.ErrorViewer.showError(ErrorViewer.java:72)
at forge.error.ErrorViewer.showError(ErrorViewer.java:53)
at forge.properties.ForgeProps.<clinit>(ForgeProps.java:31)
... 1 more
Could not find the main class: forge.Gui_NewGame. Program will exit.

I have no idea how to interpret this. My experiments so far to combine the lines or create a launcher have all failed.

I have the exact same question for TripleA, the Axis & Allies clone...to play it, I play it by entering these two lines:

cd TripleA
./triplea_unix.sh

I'm guessing that once I understand how to "shortcut launch" Forge, a very similar solution will work for this one to.

I'm running Ubuntu Studio 9.10.

Thanks,

Zirbert

Last edited by Zirbert; 10-10-2010 at 07:52 PM. Reason: added distro info
 
Old 10-10-2010, 08:15 PM   #2
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,817

Rep: Reputation: 609Reputation: 609Reputation: 609Reputation: 609Reputation: 609Reputation: 609
Code:
cd /media/sda5/Forge; java -jar run-forge.jar
?

It says it can't find forge.properties, and you missed the cd'ing part.
 
Old 10-11-2010, 05:15 PM   #3
Zirbert
LQ Newbie
 
Registered: Oct 2010
Distribution: Ubuntu Studio
Posts: 13

Original Poster
Rep: Reputation: 0
Thanks, AlucardZero! That gets me to pretty much where I wanted to be! I'm such a newbie on the command line that I didn't realize I could separate statements with a semicolon. I tried a colon (a leftover from my Commodore Basic days, the last time I did any real programming work), but that obviously didn't work.

The same solution worked for TripleA as well:

Code:
cd TripleA; ./triplea_unix.sh
fires it up with a single line.

I had though that putting the full file path in the java -jar statement (java -jar <full path including .jar filename>) would do the trick, instead of navigating to the folder then executing, but evidently not.


One more followup question, more for my own education (hopefully) than anything else. I tried making a desktop Launcher for the Forge startup command. I made a new Launcher, with type Application in Terminal, with the Command as follows (the same thing I type in a terminal window to start the game):

Code:
cd /media/sda5/Forge; java -jar run-forge.jar
This pops up a terminal window, but nothing appears in the window and I get an error popup reading:

There was an error creating the child process for this terminal

Setting the Type to Application or Location doesn't work either (although with different errors). Is there a way to make this Launcher work?

Thanks again,

Zirbert
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Opening "Application Launcher" from command line -- KDE 4.1 andrems Linux - Desktop 3 09-09-2008 06:56 AM
Is there a command line option to lock the screen? Thaidog Linux - General 3 09-17-2007 02:11 AM
Command line option -F means what? TSynergy Linux - Newbie 5 11-15-2005 09:01 PM
Kdetv command line (missing?) option AliDigitaly Linux - Software 0 09-30-2005 06:11 PM
perl command line option question afshin Programming 2 01-22-2003 09:16 PM


All times are GMT -5. The time now is 08:44 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration