jEdit Community - Resources for users of the jEdit Text Editor
Creating EXE for file association
Submitted by proee on Friday, 10 October, 2008 - 22:19
Hello,

My computer need a cold reinstall of windows yesterday so I've been downloading all my favorite programs again. I've installed the latest version of jEdit but don't see an exe to associate files with windows. I read this died back in version 4.2

Bottom line, I have some programs that rely on passing their file to the exe so I can open it in jedit.

The biggest emergency I have it to find a way to associate this firefox plugin https://addons.mozilla.org/en-US/firefox/addon/4125 to jedit. It's used to edit html textboxes with your favorite editor.

Any help here is very much apprehiated.....
Comment viewing options
Select your preferred way to display the comments and click 'Save settings' to activate your changes.
Jedit EXE Launcher
by proee on Fri, 10/10/2008 - 22:48
Hello, after some tedious Googling, I found this person who found a good solution. Bless his heart...

http://mrhaki.blogspot.com/2008/03/use-janel-to-create-windows-executable.html

Starting a Java application as executable in Windows, without the use of .bat or .cmd files, can now easily be done using Janel. With Janel we can launch Java applications with an .exe file, just like any other application in Windows. I use JEdit a lot and I always wanted to start it with something like jedit.exe. And as it turned out it only took my one minute of configuring Janel to get my jedit.exe.

We need to follow the following steps:

* First we must download Janel and extract the downloaded file to a directory.
* Then we must copy the files JanelWindows.exe, JanelWindows.lap and msvcr71.dll to the JEdit directory.
* We rename the files JanelWindows.exe and JanelWindows.lap to jedit.exe and jedit.lap.
* Now we only have to open jedit.lap in a text editor and set the properties:
o -Djava.class.path to the jedit.jar file,
o janel.main.class to org.gjt.sp.jedit.jEdit
o and janel.main.argument to -reuseview.

We can now use jedit.exe to run JEdit.
 
Nice, but...
by elberry on Fri, 10/10/2008 - 23:01
Nice. I had no idea a product like this existed. Smiling

But why? Did associating files with the jedit.bat not work? The bat file basically does exactly what the .lap file seems to do? There's no real reason why you need a .exe file. Plus in the future, if changes are made in the way jEdit is started, those changes would be applied to the .bat file that comes with jEdit. You are now responsible for maintaining your own .exe file.

Learn from the past. Live in the present. Plan for the future.
11101000
Blog
 
Close, but still not working...
by proee on Fri, 10/10/2008 - 23:42
Actually, the exe worked but it won't open a file passed to it. I didn't realize the power of the .bat file. My problem is I'm trying to get this browser extension to open using jEdit...

https://addons.mozilla.org/en-US/firefox/addon/4125

This extension allows you to take a textBox (like the one I'm writing this comment with) and pass the text into your favorite browser. The only problem is that this plugin doesn't seem to work when point to the .bat file.

I'd really like to figure out a way to make this work as I use jEdit a lot for web development and use this plugin to save myself a lot of time from having to exit html inside and textbox.

Any suggestions would be greatly appreciated....
 
Hi this firefox Add-on is a v
by Robert Schwenn on Sat, 11/10/2008 - 17:09
Hi this firefox Add-on is a very nice tip! I just tried it, and for me it works like a charm. I configured the editor as "G:\Tools\jEdit_43pre15\jedit.bat". This Batch has one line:

start "jEdit startup" javaw.exe -Xms64M -Xmx192M -jar "G:\Tools\jEdit_43pre15\jedit.jar" -reuseview %*

Robert
 
It Works!
by proee on Sun, 12/10/2008 - 04:04
Robert,

Thanks for trying this out. I actually tried this before with the bat file and it failed to bring up the editor. This time it worked fine so I must have had something out of line. Thanks for taking the time to test this out. I use jedit a lot when edit html code from within my CMS control panel. Since the code is inside a database, it's not so easy to open it via a file.

Regards,
Joe
 
Hi proee, maybe this can be u
by tvojeho on Sat, 11/10/2008 - 09:05
Hi proee, maybe this can be useful to you. I used AutoHotkey scripting language to create the launcher and then its bundled compiler Ahk2Exe to create exe file. You can get AutoHotkey at www.autohotkey.com. I am no programmer, so it is a quite rough code, but you can adjust the paths and compile the launcher yourself: it works quite well for me.
Cheers, tvojeho

;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
;
; Title: jEdit Launcher
; AutoHotkey Version: 1.x
; Language: English
; Platform: Win9x/NT
;
; Script Function: Runs jedit.jar with parameters passed in command line.
; Note: Quotes passed in command line must be escaped by backslash '\'.
; Otherwise they are disregarded in the script.
;
; 1.00.00 -- 2008/10/11
;
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

#NoTrayIcon

;-- Declare variables
Settings_dir = C:\Program Files\jEdit\jEdit Settings
jEdit_jar = C:\Program Files\jEdit\jedit.jar ; path to jar
EnvGet, DEFAULT_JAVA_HOME, JAVA_HOME ; get from environment variable
; DEFAULT_JAVA_HOME = C:\Program Files\Java\jre1.6.0_04 ; or define manually
JAVA_HEAP_INIT_SIZE=32 ; Set jvm heap initial and maximum sizes (in megabytes).
JAVA_HEAP_MAX_SIZE=256
jEdit_exe = "%DEFAULT_JAVA_HOME%\bin\javaw.exe" -Xms%JAVA_HEAP_INIT_SIZE%M -Xmx%JAVA_HEAP_MAX_SIZE%M -Dsun.java2d.noddraw=true -jar "%jEdit_jar%" -reuseview -settings="%Settings_dir%"

;-- Parameters passed in command line
Cmd_line_parameters = %1% %2% %3% %4% %5% %6% %7% %8% %9% %10%
;-- or use quotes in the script
; Cmd_line_parameters = "%1%" "%2%" "%3%" "%4%" "%5%" "%6%" "%7%" "%8%" "%9%" "%10%"

;-- Run command with parameters from command line
Run, %jEdit_exe% %Cmd_line_parameters%
ExitApp
 
Thanks
by proee on Sun, 12/10/2008 - 04:05
tvojeho,

Thanks for taking the time to reply to my request. Robert got it working with the bat file and that's all I need. I'm sure your solution is valid as well and will help another person that finds this via Google.

Regards,
Joe
User login
Browse archives
« November 2024  
MoTuWeThFrSaSu
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
 
Poll
Are you interested in language packs for jEdit?
Yes, and I could help maintain translations
26%
Yes, I'd like to have translations
32%
Indifferent
35%
No, that'd be bad (please comment)
7%
Total votes: 1093
Syndication
file   ver   dls
German Localization light   4.4.2.1   101634
Context Free Art (*.cfdg)   0.31   46062
BBEdit scheme   1.0   18601
JBuilder scheme   .001   18502
ColdFusion scheme   1.0   18031
R Edit Mode - extensive version   0.1   17481
Advanced HTML edit mode   1.0   16213
Matlab Edit Mode   1.0   16075
jEdit XP icons   1.0   15236
XP icons for jEdit   1.1   14300