Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Portage & Programming
  • Search

running a java jar file from a different directory[solved]

Problems with emerge or ebuilds? Have a basic programming question about C, PHP, Perl, BASH or something else?
Post Reply
Advanced search
3 posts • Page 1 of 1
Author
Message
logical_guy
Apprentice
Apprentice
Posts: 269
Joined: Tue Sep 18, 2007 3:14 pm

running a java jar file from a different directory[solved]

  • Quote

Post by logical_guy » Fri Jul 06, 2012 7:17 pm

Hi, I've got a java jar file in a directory and its got a subdirectory with some fonts in it that the java app uses. How do I put a link to this java app in the /usr/bin folder so everyone can use it? Thanks.
Last edited by logical_guy on Tue Jul 10, 2012 2:43 pm, edited 1 time in total.
Top
Bzub
Tux's lil' helper
Tux's lil' helper
Posts: 89
Joined: Sat Dec 25, 2004 11:21 am
Location: Belgium

Re: running a java jar file from a different directory

  • Quote

Post by Bzub » Mon Jul 09, 2012 10:32 pm

logical_guy wrote:Hi, I've got a java jar file in a directory and its got a subdirectory with some fonts in it that the java app uses. How do I put a link to this java app in the /usr/bin folder so everyone can use it? Thanks.
Hi,

Easiest solution I can think of is making a small bash script:

Put this in a file and give it a name you like, I'm calling it MyApp

Code: Select all

#!/bin/bash
cd /path/to/jar/file
java -jar MyApp.jar
Change MyApp permissions

Code: Select all

chown root:root MyApp # makes user: root and group: root owner of this file
chmod 755 MyApp # change permissions of MyApp to -rwxr-xr-x
Put that in /usr/bin (or better /usr/local/bin) and it should work.
Top
logical_guy
Apprentice
Apprentice
Posts: 269
Joined: Tue Sep 18, 2007 3:14 pm

  • Quote

Post by logical_guy » Tue Jul 10, 2012 2:43 pm

Great stuff, bro, thanks a mill - it worked!! Help much appreciated :D
Top
Post Reply

3 posts • Page 1 of 1

Return to “Portage & Programming”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic