LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > General
User Name
Password
General This forum is for non-technical general discussion which can include both Linux and non-Linux topics. Have fun!

Notices


Reply
  Search this Thread
Old 06-08-2006, 12:58 AM   #1
MRMadhav
Member
 
Registered: Nov 2005
Location: Mauritius
Distribution: PCQLinux, SUSE Linux,Fedora Core 5, Fedora Core 6, Knoppix Live, Kubuntu Edgy, PCLinuxOS
Posts: 167

Rep: Reputation: 30
Start equivalent of windows in linux


Hi, in windows i use start in a bat file to start the java vm eg:

start java Prog1.class

Now i want to have a command just like that in linux! By using this command i always get the java terminal window! Even if the appl is launched through another java appl! Any Idea?
 
Old 06-08-2006, 01:12 AM   #2
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Hi -

I'm not sure I understand your question. But:

1. You typically run a Java program with syntax like:

java MyClass

2. The syntax is the same whether it's a Windows .bat file or a Linux shell script. It runs the program, whether the Java program uses the java.System command line or a Swing GUI.

3. Unfortunately, if you're on Windows, this syntax *requires* a DOS command prompt, whether you want one or not.

4. But if you're on Windows, you can use "javaw.exe" instead of the command-line "java" to start your JVM. In this case, you do *not* need a command prompt:

javaw MyClass

'Hope that helps .. PSM
 
Old 06-08-2006, 03:15 AM   #3
MRMadhav
Member
 
Registered: Nov 2005
Location: Mauritius
Distribution: PCQLinux, SUSE Linux,Fedora Core 5, Fedora Core 6, Knoppix Live, Kubuntu Edgy, PCLinuxOS
Posts: 167

Original Poster
Rep: Reputation: 30
thanks but thats not it. If you have windows you may try it. When you put start instead of putting java directly, you will see that the name of the terminal will be called java in the taskbar. in fact another terminal is open for the operation and first command prompt is continued! Try it, you will understand it better!
 
Old 06-08-2006, 03:31 AM   #4
MRMadhav
Member
 
Registered: Nov 2005
Location: Mauritius
Distribution: PCQLinux, SUSE Linux,Fedora Core 5, Fedora Core 6, Knoppix Live, Kubuntu Edgy, PCLinuxOS
Posts: 167

Original Poster
Rep: Reputation: 30
Post Ok Look at that

Code:
C:\Documents and Settings\kaveeta>start  /?
Starts a separate window to run a specified program or command.

START ["title"] [/Dpath] [/I] [/MIN] [/MAX] [/SEPARATE | /SHARED]
      [/LOW | /NORMAL | /HIGH | /REALTIME | /ABOVENORMAL | /BELOWNORMAL]
      [/WAIT] [/B] [command/program]
      [parameters]

    "title"     Title to display in  window title bar.
    path        Starting directory
    B           Start application without creating a new window. The
                application has ^C handling ignored. Unless the application
                enables ^C processing, ^Break is the only way to interrupt
                the application
    I           The new environment will be the original environment passed
                to the cmd.exe and not the current environment.
    MIN         Start window minimized
    MAX         Start window maximized
    SEPARATE    Start 16-bit Windows program in separate memory space
    SHARED      Start 16-bit Windows program in shared memory space
    LOW         Start application in the IDLE priority class
    NORMAL      Start application in the NORMAL priority class
    HIGH        Start application in the HIGH priority class
    REALTIME    Start application in the REALTIME priority class
    ABOVENORMAL Start application in the ABOVENORMAL priority class
    BELOWNORMAL Start application in the BELOWNORMAL priority class
    WAIT        Start application and wait for it to terminate
    command/program
                If it is an internal cmd command or a batch file then
                the command processor is run with the /K switch to cmd.exe.
                This means that the window will remain after the command
                has been run.

                If it is not an internal cmd command or batch file then
                it is a program and will run as either a windowed application
                or a console application.

    parameters  These are the parameters passed to the command/program


If Command Extensions are enabled, external command invocation
through the command line or the START command changes as follows:

non-executable files may be invoked through their file association just
    by typing the name of the file as a command.  (e.g.  WORD.DOC would
    launch the application associated with the .DOC file extension).
    See the ASSOC and FTYPE commands for how to create these
    associations from within a command script.

When executing an application that is a 32-bit GUI application, CMD.EXE
    does not wait for the application to terminate before returning to
    the command prompt.  This new behavior does NOT occur if executing
    within a command script.

When executing a command line whose first token is the string "CMD "
    without an extension or path qualifier, then "CMD" is replaced with
    the value of the COMSPEC variable.  This prevents picking up CMD.EXE
    from the current directory.

When executing a command line whose first token does NOT contain an
    extension, then CMD.EXE uses the value of the PATHEXT
    environment variable to determine which extensions to look for
    and in what order.  The default value for the PATHEXT variable
    is:

        .COM;.EXE;.BAT;.CMD

    Notice the syntax is the same as the PATH variable, with
    semicolons separating the different elements.

When searching for an executable, if there is no match on any extension,
then looks to see if the name matches a directory name.  If it does, the
START command launches the Explorer on that path.  If done from the
command line, it is the equivalent to doing a CD /D to that path.
Thats the default behaviour! Now i use start only when debugging my appls. The reason is that I have a java appl that launches a totally diferrent appls through a bat file and then exits. When the first appl launches the second appl, i don't get any terminal for the 2nd appl unless i use start. This is the same for linux except that i don't know the eqivalent of start in linux!
 
Old 06-08-2006, 03:52 AM   #5
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu ; CentOS ; Raspbian
Posts: 12,613

Rep: Reputation: 69
My I-don't-use-windows-at-all-or-java-for-that-matter guess is something like:
xterm /opt/java/bin/java ...

You'd open a terminal that way to launch the program. If you are talking more along the lines of launching java in a seperate window anytime you go to a website that serves up a java applet, my guess would be that you could create a small script:

Find the browser plugin for java, probably somewhere like:
/opt/java/nsplugin/java

And move it:
mv /opt/java/nsplugin/java /opt/java/nsplugin/java-real
And then, create a new file called java in that same directory, and have the contents of that file be something along the lines of:
xterm /opt/java/nsplugin/java-real

And give that a try.

I have no way of 'firing up windows' to give it whirl, so that's my best guess. You can probably hold out for someone more experienced with Java to give you a better answer.

Cool
 
Old 06-08-2006, 03:53 AM   #6
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu ; CentOS ; Raspbian
Posts: 12,613

Rep: Reputation: 69
Ah, almost forgot, the -e:
xterm -e /path/to/java

HTH

Cool
 
Old 06-08-2006, 11:33 AM   #7
MRMadhav
Member
 
Registered: Nov 2005
Location: Mauritius
Distribution: PCQLinux, SUSE Linux,Fedora Core 5, Fedora Core 6, Knoppix Live, Kubuntu Edgy, PCLinuxOS
Posts: 167

Original Poster
Rep: Reputation: 30
Thanks MasterC! It just what i have been asking for! The xterm -e always open the appl in a new window!
 
Old 06-08-2006, 12:01 PM   #8
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Hi -

You usually *don't* want an extra window popping up. And with the Windows "java" command, you get one, whether you want it or not. With or without the Windows "start" command. Unless you use "javaw".

In Windows or Linux, you usually just want to either a) use the existing command line, or b) create your own new (e.g. Swing) GUI frame. In neither case do you go and open a new command window.

Anyway, glad you found out about "xterm -e" (for whenever you need it), and glad you're squared away with your question!

Your .. PSM

Last edited by paulsm4; 06-08-2006 at 12:03 PM.
 
Old 06-08-2006, 02:05 PM   #9
MRMadhav
Member
 
Registered: Nov 2005
Location: Mauritius
Distribution: PCQLinux, SUSE Linux,Fedora Core 5, Fedora Core 6, Knoppix Live, Kubuntu Edgy, PCLinuxOS
Posts: 167

Original Poster
Rep: Reputation: 30
No, thats the catch! i don't get the java command line when i launch another java appl through a java appl! Thats why i used start and now xterm -e for linux. In fact i use this command just for debuging purposes where an error has eluded me! At runtime you get all the possible errors that you won't get during compilation and thats the advantage of having the other window! I use javaw only when installing the appl to work live!
 
  


Reply



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
Linux equivalent to Windows Explorer sjia Linux - Software 22 10-13-2013 04:32 AM
Windows Notepad Equivalent in Linux? Bob5 Linux - Software 21 09-16-2013 02:43 AM
equivalent Linux command for windows start cmd alix123 Programming 4 11-16-2008 06:06 PM
What is the equivalent of Windows events in Linux DavidW567 Programming 8 12-24-2004 05:14 PM
Linux equivalent to windows registry? marri Linux - Newbie 10 07-22-2004 12:07 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > General

All times are GMT -5. The time now is 05:01 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
Open Source Consulting | Domain Registration