Create account / Log in

Compatibility with user-provided user.home

Suggestions for additional features for the module editor and Vassal engine.

Moderators: uckelman, Tim M

Postby morvael » January 14th, 2010, 10:20 pm

The Module Manager is launched directly from JavaPortableLauncher by opening VEngine.jar (that's the only way it's possible), I wonder what are the params given to it.

Then I select the module to open and the newly launched java process is created with params that look ok, but no game shows and the java process just works in background (to be seen in Task Manager).

The command line from errorLog:
E:\dominik\portable\PortableApps\CommonFiles\Java\bin\java -Xms256M -Xmx512M -DVASSAL.id=1 -Duser.home=E:\dominik\portable\PortableApps\JavaPortableLauncher\Data\AppData -cp X:\Downloads\vl\lib\Vengine.jar VASSAL.launch.Player

The java used is correct one from PortableApps, user.home too. Maybe the class path is missing something?
User avatar
morvael
 
Posts: 84
Joined: July 22nd, 2008, 7:50 pm
Location: Otwock, Poland

Compatibility with user-provided user.home

Postby uckelman » January 17th, 2010, 4:32 pm

Thus spake "morvael":
The Module Manager is launched directly from JavaPortableLauncher by opening
VEngine.jar (that's the only way it's possible), I wonder what are the params
given to it.

Then I select the module to open and the newly launched java process is creat
ed with params that look ok, but no game shows and the java process just work
s in background (to be seen in Task Manager).

The command line from errorLog:
E:\dominik\portable\PortableApps\CommonFiles\Java\bin\java -Xms256M -Xmx512M
-DVASSAL.id=1 -Duser.home=E:\dominik\portable\PortableApps\JavaPortableLaunch
er\Data\AppData -cp X:\Downloads\vl\lib\Vengine.jar VASSAL.launch.Player

The java used is correct one from PortableApps, user.home too. Maybe the clas
s path is missing something?


The only thing you need on the classpath is Vengine.jar. If the classpath
were wrong, you'd be getting an exception right away.

Can you attach to the Player's JVM with a debugger so you can see what
it's doing?
--
J.

_______________________________________________
Messages mailing list
Messages@forums.vassalengine.org
http://forums.vassalengine.org/mailman/ ... engine.org

Post generated using Mail2Forum (http://www.mail2forum.com)
User avatar
uckelman
Site Admin
 
Posts: 8874
Joined: December 10th, 2007, 9:48 am
Location: Durham, England

Postby morvael » January 18th, 2010, 8:28 pm

What's the easiest method to do it? I have Eclipse without Vassal project and Netbeans with Vassal project.
User avatar
morvael
 
Posts: 84
Joined: July 22nd, 2008, 7:50 pm
Location: Otwock, Poland

Compatibility with user-provided user.home

Postby uckelman » January 19th, 2010, 7:08 pm

Thus spake "morvael":
What's the easiest method to do it? I have Eclipse without Vassal project and
Netbeans with Vassal project.


That's a good question. I doubt that you'll be able to do it with Eclipse
or Netbeans, because you said that it happens only when launching from
JavaPortableLauncher.

I think you could modify AbstractLaunchAction to start the Player or Editor
with 'jdb' instead of 'java', or pass it the '-agentlib' argument with
the right flags so that you could attach with jdb once it's running. (See
the man page for jdb for examples.) If you need help with that, let me know.

--
J.

_______________________________________________
Messages mailing list
Messages@forums.vassalengine.org
http://forums.vassalengine.org/mailman/ ... engine.org

Post generated using Mail2Forum (http://www.mail2forum.com)
User avatar
uckelman
Site Admin
 
Posts: 8874
Joined: December 10th, 2007, 9:48 am
Location: Durham, England

Postby morvael » January 19th, 2010, 8:52 pm

I think it would be possible to find out what are the parameters used by JPL to launch jars, maybe then those parameters could be provided in the IDE to launch debug?

As JPL is open source and the source is always included I have been able to find out what it does once the jar is selected:

Code: Select all
            System::Call 'Kernel32::SetEnvironmentVariableA(t, t) i("JAVAHOME", "$PortableAppsPath\CommonFiles\Java").r0'
            System::Call 'Kernel32::SetEnvironmentVariableA(t, t) i("CLASSPATH", ".").r0'
            CreateDirectory "$EXEDIR\Data"
            CreateDirectory "$EXEDIR\Data\AppData"
            System::Call 'Kernel32::SetEnvironmentVariableA(t, t) i("APPDATA", "$EXEDIR\Data\AppData").r0'
            SetOutPath $0
            Exec `"$PortableAppsPath\CommonFiles\Java\bin\javaw.exe" -Duser.home="$EXEDIR\Data\AppData" -jar "$JarPath"`


I guess this "code" is easily readable. Three environment variables are set pointing to portable data directories and the launch is a standard launch with just -Duser.home provided.

This can be replicated in the IDE I think.
User avatar
morvael
 
Posts: 84
Joined: July 22nd, 2008, 7:50 pm
Location: Otwock, Poland

Postby morvael » January 25th, 2010, 1:14 pm

What is funny is that Sun accepted my bug, although now I'm unsure it's a bug as you said (that PB doesn't have to be specially tuned to launch java apps with the same settings):

http://bugs.sun.com/bugdatabase/view_bu ... id=6919620
User avatar
morvael
 
Posts: 84
Joined: July 22nd, 2008, 7:50 pm
Location: Otwock, Poland

Previous

Return to Feature Requests

Who is online

Users browsing this forum: No registered users and 3 guests