Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (480)
Games in Android Showcase (110)
games submitted by our members
Games in WIP (546)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Java on Shell  (Read 1875 times)
0 Members and 1 Guest are viewing this topic.
Offline ReBirth
« Posted 2013-03-11 04:51:30 »

Is there a way to make a java class to act like shell command? Like
1  
> ClassName [parameter] [values]

Similar to "apt-get install whatever". In current state, we have to include "java" command everytime we call it.

Or it's impossible so I need to learn bash? persecutioncomplex

Offline Agro
« Reply #1 - Posted 2013-03-11 05:02:28 »

I think you can run a class file from shell. Think I've done it before, can't remember how.

Offline ra4king

JGO Kernel


Medals: 345
Projects: 2
Exp: 5 years


I'm the King!


« Reply #2 - Posted 2013-03-11 05:08:37 »

Alias.

1  
alias ClassName="java ClassName"

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline ReBirth
« Reply #3 - Posted 2013-03-11 11:57:36 »

Ok I'll try it.

Another thing,
1) how to get the java program listed in repository?
2) how to make the program take over the terminal screen, like when we use nano or other text editors?
3) Can java program has auto-completion too? (tab key)

Offline ra4king

JGO Kernel


Medals: 345
Projects: 2
Exp: 5 years


I'm the King!


« Reply #4 - Posted 2013-03-11 12:09:23 »

1. Not sure but I'm pretty sure it's not as simple as submitting a jar since there are strict requirements on the packaging and executing structure.

2. You can't.

3. Not possible with any console application AFAIK.

Offline cylab

JGO Ninja


Medals: 43



« Reply #5 - Posted 2013-03-11 12:44:19 »

Take a look at beanshell: http://www.beanshell.org/home.html

But java is not the best shell language, so learning bash might turn out the better decision...

Mathias - I Know What [you] Did Last Summer!
Offline ReBirth
« Reply #6 - Posted 2013-03-11 14:42:49 »

I have looked on beanshell, what exactly is it? I read the intro, quick start, but get no point of its purpose.

Offline nsigma
« Reply #7 - Posted 2013-03-11 15:14:15 »

2) how to make the program take over the terminal screen, like when we use nano or other text editors?

2. You can't.

Can't?  Wink  Try googling Java terminal curses

This looks like it could be interesting - http://code.google.com/p/lanterna/ - and without native libs too.

There's also JCurses, though that requires natives.


Praxis LIVE - open-source intermedia toolkit and live interactive visual editor
Digital Prisoners - interactive spaces and projections
Offline kevglass

JGO Kernel


Medals: 152
Projects: 23
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #8 - Posted 2013-03-11 15:23:34 »

Ooooh, lanterna looks good!

Kev

Offline sproingie

JGO Kernel


Medals: 202



« Reply #9 - Posted 2013-03-11 15:24:03 »

You might want to run java as
java -noverify
for commandline apps that you want to start up quicker.  You can also look into nailgun for even faster startup though there's some security caveats that apply to that.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline ra4king

JGO Kernel


Medals: 345
Projects: 2
Exp: 5 years


I'm the King!


« Reply #10 - Posted 2013-03-11 19:51:15 »

2) how to make the program take over the terminal screen, like when we use nano or other text editors?

2. You can't.

Can't?  Wink  Try googling Java terminal curses

This looks like it could be interesting - http://code.google.com/p/lanterna/ - and without native libs too.

There's also JCurses, though that requires natives.
Huh so with Lantern, to enter private mode, it write a bunch of weird characters out and executes an external process. O_o

Offline cylab

JGO Ninja


Medals: 43



« Reply #11 - Posted 2013-03-12 10:39:19 »

I have looked on beanshell, what exactly is it? I read the intro, quick start, but get no point of its purpose.
well its a shell to script beans - hence java classes. you can run it interactively from the commandline, so youmight get a better environment for interacting with your classes. there is also groovyshell http://groovy.codehaus.org/Groovy+Shell#GroovyShell-Features which might offer more features.

OT: man - I hate posting here from my 2.3 android phone. does it work better with 4.1?

Mathias - I Know What [you] Did Last Summer!
Offline nsigma
« Reply #12 - Posted 2013-03-12 10:58:36 »

Huh so with Lantern, to enter private mode, it write a bunch of weird characters out and executes an external process. O_o

Isn't that kind of how this whole thing works?  Wink http://en.wikipedia.org/wiki/ANSI_escape_code

OT: man - I hate posting here from my 2.3 android phone. does it work better with 4.1?

An almost immeasurably tiny amount.  Grin

Praxis LIVE - open-source intermedia toolkit and live interactive visual editor
Digital Prisoners - interactive spaces and projections
Offline ReBirth
« Reply #13 - Posted 2013-03-12 12:22:07 »

@nsigma
That looks great! Unfortunately there's no example code yet, but I hope it can get along with shell.

@cylab
So that's it. It seems provide easy way to invoke GUI. However lanterna maybe more suitable for me.

Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

atombrot (21 views)
2014-08-19 09:29:53

Tekkerue (21 views)
2014-08-16 06:45:27

Tekkerue (21 views)
2014-08-16 06:22:17

Tekkerue (12 views)
2014-08-16 06:20:21

Tekkerue (19 views)
2014-08-16 06:12:11

Rayexar (56 views)
2014-08-11 02:49:23

BurntPizza (37 views)
2014-08-09 21:09:32

BurntPizza (29 views)
2014-08-08 02:01:56

Norakomi (35 views)
2014-08-06 19:49:38

BurntPizza (65 views)
2014-08-03 02:57:17
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!